A multitenant solution is one used by multiple customers, or tenants. Tenants are distinct from users. Multiple users from a single organization, company, or group form a single tenant.
There is a solution architecture for provisioning multi-tenant system by using multiple database.
What you need to understand :
- Logical and physical tenants
Logical tenant is what user see but physical tenant is something at real physical sharing between tenants.
For example : Logical tenant A and B is share same physical resource (app, database, services..).
2. level of multi tenant isolation
We have different level of isolation sharing between multi tenants :
Each solution for isolation level has pros and cons. For example of Database isolation:
|One database per tenant||Database can be created in dedicated server or distributed to many servers. Hard for provisioning and manage. But highest scalability.|
|One table per tenant||Each tenant has own table with prefix_name. Share same single db.|
Less database instance to manage.
|One table share multi tenants||Each table has column tennant_id to classify each tenant data. Harder to scale for each tenant separately.|