Hi,
We are evaluating NATS for our dynamic message switch and hope to get better understanding on how well NATS performs with millions of subjects and frequent SUB & UNSUB.
A simplified use case is like the following:
1. Clients connect and disconnect frequently to exchange messages between each other.
2. Clients are mapped to NATS subjects.
3. Clients connect to API servers directly and API servers maintain connections to NATS servers.
4. When a client connects to an API gateway, it adds a subscription to the subject that belongs to the client and starts receiving messages.
5. When a client disconnects from the API gateway, it removes the subscription for the client.
We hope to know:
1. Is it a reasonable design with NATS?
2. How many subjects and subscriptions a single NATS server can typically support? Do they scale easily with NATS server clustering?
3. Will frequent SUB & UNSUB cause performance issues for single NATS server or/and NATS server clustering? After carefully reading NATS server protocol, it seems to me that frequent SUB & UNSUB will generate broadcast traffic between servers. Is it correct?
4. What is the normal message delivery latency with a single NATS server and NATS server clustering?
We really appreciate your insights.
Thank you!