Creating A Subscription

Subscriptions are defined in node configuration where they define what data moves where. Subscriptions are exclusively table level and operate independently. In order for data to fully move across a large Cluster, a grouping of subscriptions across nodes will need to be created. Channels, Publish, and Subscribe are all settings within a Subscription. See below definitions for more information about each. Subscriptions can also be referred to as pub/sub functionality.

 

Publish
A single directionality data flow that will push table transactions from one HarperDB node to another across a clustering connection. Transactions are published only after a transaction has completed on the local node.

 

{
  "operation": "add_node",
  "name": "node_2",
  "host": "192.168.0.12",
  "port": 12345,
  "subscriptions": [
    {
      "channel": "dev:dog",
      "subscribe": false,
      "publish": true
    }
  ] 
}

Subscribe
A single directionality data flow that listens for table transactions on another HarperDB node. When a transaction completes on the other node that transaction is then sent to the subscriber node where it will be executed upon receipt.

 

{
  "operation": "add_node",
  "name": "node_2",
  "host": "192.168.0.12",
  "port": 12345,
  "subscriptions": [
    {
      "channel": "dev:dog",
      "subscribe": true,
      "publish": false
    }
  ] 
}