Synadia Cloud

Leaf Nodes

A Leaf Node extends an existing NATS system. A leafnode server will transparently route messages as needed from local clients to one or more remote NATS system(s) and vice versa. The leaf node authenticates and authorizes clients using a local policy. Messages are allowed to flow to the cluster or into the leaf node based on leaf node connection permissions of either.

Leaf nodes are useful in IoT and edge scenarios and when the local server traffic should be low RTT and local unless routed to the super cluster. NATS' queue semantics are honored across leaf connections by serving local queue consumers first.

In Synadia Cloud

You can connect your local NATS servers (or full clusters) as leaf nodes to Synadia Cloud.

The leaf node will connect as a user to Synadia Cloud. It is recommended to create a dedicated user with restricted subject permissions for leaf node connections.

Note that the Synadia Cloud cannot manage accounts and users in those leaf nodes. Those are entirely under your control.

Further documentation

NATS Documentation - Using Leaf nodes

NATS Documentation - Example leaf node setup

Connecting an existing server

Make sure the server has:

  • A cluster name defined
  • A JetStream domain defined (if you want to user JetStream)
  • The remote is associated with an account on the leaf node
cluster: {
	name: leaf
}

leafnodes {
    remotes = [
        {
          url: "tls://connect.ngs.global"
          credentials: "NGS-Default-leaf.creds"
          account: APP_EDGE
        },
    ]
}

jetstream {
  store_dir: jsleaf
  domain: leaf
}

accounts: {
  APP_EDGE: {
    jetstream: enabled
    users: [ { user: edge_user, password: s3cr3t } ]
  }
}
Previous
Placement Tags