Topics

Topic is the core concept of JoinBase which bridges three data standards or protocols - database, MQTT and HTTP.

Topic is just an URI or path for addressing the database entities. JoinBase extends the database qualified table to MQTT/HTTP protocols to unify the representation of storage objects or data sinks. With topic, JoinBase has one unique data entity object semantic description under all different protocols.

Core

Asynchronous Replication Diagram

In the JoinBase, the data sink is just described by the qualified table, a.k.a., database.table. The qualified table is just the topic called in MQTT protocol and the path called in HTTP protocol.

For example, the following PG console or shell commands are equivalent:

ProtocolsDB Entity/Topic/PathStatements/Commands
Databaseabc.tinsert into abc.t values (1,2)
MQTT/abc/tmosquitto_pub -d -t /abc/t -h 127.0.0.1 -u abc -P abc -m '{"a":1,"b":2}'
HTTP/abc/tcurl -H 'X-JoinBase-User: abc' -H 'X-JoinBase-Key: abc' -X POST 'http://127.0.0.1:8080/abc/t' -d '{"a":1,"b":2}'

Topic Aliases

To provide the greatest degree of semantic compatibility, JoinBase supports the concept called Topic Aliases.

With topic aliases, You can mapping any topic/path into the normalized topic/path in JoinBase. This is done by setting the mappings in the conf file. For example, the following lines in the conf,

[topic.aliases]
"/abc/sensors" = ["/edge/x2view/1234567890/some_deeper_uri_path"]
"/abc/sensors" = ["/edge/x2view/0123456789/another_deeper_uri_path"]

Two paths "/edge/x2view/1234567890/some_deeper_uri_path" and "/edge/x2view/0123456789/another_deeper_uri_path" are mapped to one single normalized topic "/abc/sensors" which is equivalent to the database entity "abc.sensors".