Multi-tenancy is an architecture in which a single instance of a software or application servers multiple customers. Here each customer is a tenant. Tenants may have the abilities to customize some parts of the application, such as UI color, logo, company name, address etc. But tenant can’t modify the application’s code.

In this architecture multiple instances of an application operate in a shared environment. Each tenant is integrated physically, but separated logically. This types of architecture is used to enable multiple users to use a single application.

Multi-tenant architecture is used most with cloud computing. It is found in both public cloud (such as Amazon Web Services, Microsoft Azure and Google Cloud) and private cloud. Also it is a key part of another cloud model, software as a service (SaaS).

Multi-tenant Database

In multi-tenant architecture database is very important matter. There are three ways we can design our database in multi-tenant system, with different complexity and cost.

Single database, shared schema

In this system one database is used to hold all the tenant’s data. Every tenant’s data is stored in the same table. Each table has a specific column that identify tenant’s row. Select operation is costly, modify schema is easy & low costly.

TenantIdIdName
11John Abrar
12Mikel Adward
23Mr. Bell
Customer

Single database, separate schema

In this system one database is used to hold all the tenant’s data. Each tenant data is stored in the separate table.

IdName
1John Abrar
2Mikel Adward
Tenant1.Customer
IdName
1John Abrar
2Mikel Adward
Tenant2.Customer

Database per tenant

In this system each tenant has their own database.


Source link

Leave a Reply

Your email address will not be published. Required fields are marked *