Hybrid tenant architecture (multi + single)
Best of both worlds - security of single-tenant with cost benefits of multi-tenant.
A client wanted to build an app tending to organisations with multiple teams and users.
They wanted security and privacy like a single-tenant application but while also having the cost effective benefits of multi-tenant for an app.
What are Single/Multi Tenant Apps?
Let look at brief overview:
1. Single tenant:
- In these apps, entire app/server + database is used by a single customer/organisation/team.
- These are generally like the Enterprise plans which you see in SaaS applications where its custom tailored for the customer/organisation with separate server + database running for greater flexibility and privacy.
2. Multi-tenant:
- In these apps, a single app/server + database is used by multiple customers/organisations/teams.
- These are generally the Regular/Pro plans which you see in SaaS applications and hence cheaper to run because of single server.
The Hybrid Solution
Now, coming back to the problem.
We brainstormed a bit and discussed through different trade-offs regarding both the approaches and finally decided on a hybrid approach.
There will be a single server which runs for all the apps, while also having separate database for each organisation.
This would ensure that each organisation's data is kept separately, and have enhanced privacy + security for them, while also ensuring we don't spend more money/resources on the app server.
