Multitenancy is when a number of completely different prospects are accessing the identical computing assets. For instance take into account, when a number of completely different firms are storing knowledge on the identical bodily server. Multi-tenancy is a vital characteristic of cloud computing.
What is multi-tenancy?
Multi-tenancy is an structure during which a single occasion of a software program or utility servers a number of prospects. Here every buyer is a tenant. Tenants might have the talents to customise some components of the appliance, comparable to UI shade, brand, firm title, tackle and so on. But tenant can’t modify the appliance’s code.
In this structure a number of situations of an utility function in a shared surroundings. Each tenant is built-in bodily, however separated logically. This sorts of structure is used to allow a number of customers to make use of a single utility.
Multi-tenant structure is used most with cloud computing. It is present in each public cloud (comparable to Amazon Web Services, Microsoft Azure and Google Cloud) and personal cloud. Also it’s a key a part of one other cloud mannequin, software program as a service (SaaS).
Multi-tenant Database
In multi-tenant structure database is essential matter. There are 3 ways we are able to design our database in multi-tenant system, with completely different complexity and price.
Single database, shared schema
In this technique one database is used to carry all of the tenant’s knowledge. Every tenant’s knowledge is saved in the identical desk. Each desk has a particular column that establish tenant’s row. Select operation is expensive, modify schema is straightforward & low expensive.
TenantId | Id | Name |
1 | 1 | John Abrar |
1 | 2 | Mikel Adward |
2 | 3 | Mr. Bell |
Single database, separate schema
In this technique one database is used to carry all of the tenant’s knowledge. Each tenant knowledge is saved within the separate desk.
Id | Name |
1 | John Abrar |
2 | Mikel Adward |
Id | Name |
1 | John Abrar |
2 | Mikel Adward |
Database per tenant
In this technique every tenant has their very own database.