In this post, we discuss the two approaches to software architecture: multi-instance approach and multi-tenant approach.
The term software multitenancy refers to a software architecture in which a single instance of the software runs on a server and serves multiple tenants. Systems designed in such manner are often called shared (in contrast to dedicated or isolated). A tenant is a group of users who share a common access with specific privileges to the software instance.
With a multi-tenant architecture, a software application is designed to provide every tenant a dedicated share of the instance – including its data, configuration, user management, tenant individual functionality. Multi-tenancy contrasts with the multi-instance architectures, where separate software instances operate on behalf of different tenants.
Pros and Cons
Let’s list the pros and cons of both approaches!
Multi-instance (Setup an instance per client):
- The CPU usage, memory usage, and the database load do not affect the rest of the clients.
- It is easier to provide different versions/functionalities of the application depending on client needs (e.g. theme, feature, etc).
- It is easier to remove the client and all the related data (no need to vacuum/reindex the DB).
- It is easier and more precise to detect the CPU usage and calculate the pricing per client.
- It is less cost-effective as price per unit gets higher.
- It is harder to set up and manage the deployment.
- A manager application instance would be needed to hold all the client’s personal details, collect the analytics data, etc.
Multi-tenant (Single deployment/application instance shared by all clients):
- It is more cost-effective and easier to manage the application.
- The CPU usage, memory usage, database load might affect the rest of clients. For example, if the server goes down, all the application instances will go down as well.
- It is harder to calculate the system usage per client to better define the pricing.
So it seems that the multi-tenant approach (using shared instance) makes better use of the available resources and it is more cost-effective. This should be the go-to approach if the database storage becomes a bottleneck.
However, the multi-instance approach (using dedicated instances) helps to make sure that the CPU/Database intensive requests by one client do not impact the application usage of the other client.
Your pick now!