GDPR Declaration !!

I am not collecting any personal information of any reader of or visitor to this blog. I am using Blogger, provided by Google to host this blog. I understand that Google is using cookies to collect personal information for its Analytics and Adsense applications.

Sunday, February 07, 2021

What is Multitenancy?

This is the eighth of a series of articles on 'technologies for the coming decade that I am writing in my blog. I intend to cover 21 technologies / ideas. Here is my publishing history.

  1. Artificial Intelligence
  2. Machine Learning 
  3. Deep Learning 
  4. Robotic Process Automation (RPA) 
  5. Industrial Internet of Things (IIOT)
  6. Cloud Computing 
  7. Blockchain

Introduction to Multitenancy

Let us take the example of a bank. A bank has thousands of customers. Every customer accesses the information stored in a single server. While all the customers access the same application, the data of each customer is different and secure from the data of every other customer. The balances and transactions of every customer are segregated and has no impact on the balances and transactions of other customers. 

Similar is the case with apartment complexes. Many tenants / owners live there. They pay annual charges based on the usage. Each house in the complex has its own lock and key (security) and has unique designs (configurations).

Multiple tenants sharing resources by paying periodic subscription charges that are based on resource usage, with the data of each tenant being maintained separate and secure from that of another tenant and each tenant having limited flexibility to configure their application features, access and user interfaces... 

That is Multitenancy for you. 

What Multitenancy is not

Multitenancy is different from 'Tenant Space'. This is where the customer rents out a slice of the Sever Space and uses it to install their own application, databases and code. 

Multitenancy is different from 'Multiple Application Deployment'. In this case even when the customer shares the same sever space, they access different applications installed on the server. 

For an architecture to become Multitenancy, different customers should share the same application instance. 

A formal definition of Multitenancy

Multitenancy is a feature of Cloud Computing. Gartner defines Multitenancy as 'a reference to the mode of operation of software where multiple independent instances of one or multiple applications operate in a shared environment. The instances (tenants) are logically isolated, but physically integrated. The degree of logical isolation must be complete, but the degree of physical integration will vary.' 

In a multitenant architecture, tenants share the following features.

  • They can configure their unique user interfaces and experiences.
  • They can have a unique application configuration based on their business rules and requirements. 
  • Tenants can have control on their database schema. They can add and remove database tables for example.
  • They can create users and provide them controlled access to the data. 

Three types of Multitenant architecture

1. Multitenancy with a single application and database instance: This is the simplest of the multitenant architecture. Every tenant shares the same application and database instance. This constrains the ability of the customer to configure their application instances. However, this approach is cost effective. 

2. Multitenancy with single application instance and tenant specific database instance: This option may cost higher than option one  above, but provides operational flexibility.


3. Tenant specific application and database instances: This is technically not Multitenancy. This can be called a 'Multi Instance Architecture'. This is similar to the traditional hosted model. This option is the most expensive.

Design Considerations in Multitenancy

Affinity: 

This refers to the application instances that handle tenant request. There could be four different type of affinity:

  • No affinity (Non-affine): In this case, a request from a tenant can be handled by any server where the application instance is installed. 
  • Full affinity (Affine): Here different application instances are dedicated to the Tenant. A request from the customer can be handled only by the assigned server.
 
  • Cluster affine: A group of customers are assigned a cluster of servers in which the same application instance is installed. The Tenant request can be handled by any of the server in the cluster. 
  • Inter-cluster affine: In this case a set of requests from the tenant are handled by servers in one cluster and other set of requests are handled by servers belonging to another cluster. 

Performance Isolation: 

 One of the challenges in Multitenancy is called the 'Noisy Neighbor', where performance of one tenant is impacted if another tenant with a high workload. There are three types of performance isolation: 

  1. Performance isolated: In this case every the cloud vendor meets the performance SLAs of every tenant irrespective of the workload of other tenants. The high load of another tenant may impact performance of another tenant, but stays within the SLA limits.
  2. Weak isolated: In weak isolated environments, every tenant is subject to an upper limit of resource usage. This ensures that no single tenant overuses the server resources. However, it is possible that many tenants may try to fully use the limit provided and this may lead to performance impact across the board.
  3. Non-isolated: There is no control. Tenants working within their SLAs will be negatively impacted by Tenants hogging the resources.

Customization

This is the ability of a multitenant architecture to handle tenant specific configurations and requirements. This can be handled in two ways.

  1. Configurable architecture: Each Tenant is allowed to configure the application to meet their specific requirements. The server maintains configuration files of each tenant
  2. Code extensions: In this case each tenant has access to the application code base and has the freedom to modify the code to develop bolt-on extensions to handle their specific requirements. 

Benefits of Multitenant architecture

  1. Cost reduction: Multitenancy helps customers to share resources and hence gain from economies of scale. 
  2. Scalability: Multitenancy enables temporary scalability to handle unexpected heavy loads. This is enabled because it helps the Cloud Computing vendor to redirect the load with no extra cost to the customer
  3. Efficiency: Multitenancy is more efficient as it streamlines the load on infrastructure. 
  4. Lower entry cost 
  5. Easier release management: Since all the tenants are on the same server, any application or database upgrade has to be done one time, thus making release management easier.

Challenges of Multitenancy

  1. Potential security risks: It is possible that the data corruption or application bugs generated in one customer instance could spread to other customers who share the same instance. 
  2. Compliance Issues: Some country regulations do not allow storing a company data in a shared server. 
  3. 'Noisy Neighbor Effect': Excessive use of resources by one customer (to handle peak load demand) could impact the performance of other customers that share the same resources.  
  4. Risky release management: Since a single release update of an application can impact multiple customers, any bug in the release will impact many customers. This adds a risk to any new releases.
  5. Increased testing frequency: Since the customer has to do extensive testing of every release, this adds an unnecessary load on the customer. 
  6. Challenging transition from On-premise to Cloud: Customers who has worked on dedicated on-premise or hosted application will find the controls imposed by a multitenant architecture challenging.

 References

  1. Multi-Tenant Architecture | End Point  
  2. What Is Multitenancy? | Multitenant Architecture | Cloudflare 
  3. Multitenancy - Wikipedia  
  4. The silly debate over multitenancy | InfoWorld 
  5. Wayback Machine  
  6. SaaS: Single Tenant vs Multi-Tenant - What's the Difference? | Digital Guardian 
  7. What is Multi-Tenancy (Multi-Tenant Architecture)?  
  8. Multitenancy Explained - YouTube  
  9. Multi-tenancy Made Simple - YouTube  
  10. Easy Way to Understand Multitenancy - YouTube  
  11. Multi-tenant architecture in 20 minutes - YouTube  
  12. What is multitenancy?  
  13. Definition of Multitenancy - Gartner Information Technology Glossary

No comments: