Multi Tenant App

Any advice on setting up a multi tenant app? My thinking so far is to add a field to every table and have it relate to the tenant table, and to add a field to the Users table to record the user’s tenant ID. Pub/subs could have the main token of the sub-topic being the tenant ID. Same sort of logic for other stuff that needs to be kept separate.

Thanks.

For data persistence, I’d start with a table called “Tenant” and then build your data model by relating core entities to the corresponding tenant object.

For messaging, it is what you suggested or adding an extra header to designate the tenant id.

Regards,
Mark