-
I am trying to determine if it's possible in any way to use JetStream in a single node, where that node is connected to other clusters via gateways. The use case is for a side project I'm hosting on Fly, with NATS embedded in a Go binary. I want to have the app deployed in multiple regions, and have a read replica of a KV bucket in each region to reduce latency. A deployment example would be:
The goal would be to have these form a super cluster, and each of the 1 nodes in every region have a read replica of a KV bucket that stores auth sessions. I am quite new to use NATS, so perhaps this isn't even a good idea, or there is a much better way of achieving the same result. My one idea was to make all of these nodes actually leaf nodes, but I wanted to avoid a situation where a node in Asia needs to first communicate with the US before the EU can get the message/update. However, maybe this isn't so bad. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You don't even need a super-cluster, you could simply have your 3 node cluster in the US and have each of your 1 nodes in other parts of the world connect to the cluster as Leaf Nodes. Then you can enable JS on those leaf nodes and create read replica streams that source from streams located in the cluster. |
Beta Was this translation helpful? Give feedback.
You don't even need a super-cluster, you could simply have your 3 node cluster in the US and have each of your 1 nodes in other parts of the world connect to the cluster as Leaf Nodes. Then you can enable JS on those leaf nodes and create read replica streams that source from streams located in the cluster.