I'm designing a system where customers need to be isolated from one another (separate database/application stack). Users can interact with those organizations (a user can interact with multiple organizations) so there is another database that stores user information, individual users don't need to be isolated. Think of the Slack model, except each slack workspace was a separate isolated tenant, and a user's information (that can belong to multiple workspaces) is in a different database (so users can have global statistics).

I have most of the architecture down, I'm just not sure the best way to: Track user data and store it in the user db, and pass the data to the organization.

One way I came up with is when data is stored in the user DB, an event is triggered and data is sent to a message queue. The organizations subscribe to the message queue, and when data is received store the data in their db. But not sure if this is the best solution.

Any help would be greatly appreciated!

  • Can you be a bit more specific please? What sort of data are storing in userDB and sending over tenanted organization services via message queues? (Does user data contain something organization specific?) Are these data considered read-only for the organization services? How big replication lag is acceptable for you? – Peter Csala Jul 22 '20 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.