Sharing many distributed account streams with a server-side account #5788
-
I have a "server account" in my Go server that I want to publish and consume messages from thousands of accounts (distributed IoT devices with multi-tenancy). With a URL account resolver or embedded NATS server, it's easy to import the "server account" into each distributed IoT device account JWT. However, to support streaming to the "server account", it's a little more cumbersome to import every single account public key into the "server account" JWT. Am I approaching multi-tenancy correctly by having a "server account" on my server interface with thousands of accounts through export/imports? Is there a better way to support authentication and authorization with multi-tenancy? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
My understanding of a system account is that it's not designed for this. My concept of a "server account" is distinct from this. |
Beta Was this translation helpful? Give feedback.
-
On approach is to reverse and have the server account export a single service that all new accounts import. Just means that when a new account sends to it the other side will respond for pure fire and forget, but makes management easier at those scales. |
Beta Was this translation helpful? Give feedback.
-
Publishing to a stream requires a response, so perfect for an exported service from the server account vs a stream export from the new account that forces an updated to the server account to import each new account. |
Beta Was this translation helpful? Give feedback.
-
If you are trying to publish from a new account to a "central" account, you can export a stream from the new account, or export a service from the "central" account.. But services expect responses.. |
Beta Was this translation helpful? Give feedback.
On approach is to reverse and have the server account export a single service that all new accounts import. Just means that when a new account sends to it the other side will respond for pure fire and forget, but makes management easier at those scales.