Recently, I had to give a short presentation about the topic of my PhD research to a group of people with no background in software engineering. I decided to explain multi-tenancy using a metaphor. As I have noticed many people do not understand exactly what multi-tenancy and its benefits are, I’ll elaborate on the metaphor in this blog post.
Imagine you are required to provide housing for a number of people, e.g. because you have a number of foreign employees currently working in your country. The first option to provide housing is to rent a complete house to everyone:
Although this works, there are some disadvantages to this situation:
- Costs: As every employee is required to rent a complete house, the costs are very high.
- Resource utilization: For most clients, a complete house is too large to use entirely, which results in many spare rooms.
- Maintenance: In order to do maintenance, e.g. replace the alarm system due to a bug, a maintenance guy (or girl) must visit all houses and replace the system in everyone of them.
The second option is to rent apartments to everyone, rather than complete houses:
This situation does not have the disadvantages of option 1:
- Costs: Renting an apartment is much cheaper than renting a house.
- Resource utilization: As the rented space is smaller, it is more likely that the space better fits the needs of the user. This leads to less spare rooms.
- Maintenance: As all apartments are in the same location, maintenance can be performed easier (and therefore cheaper).
Note that both a decrease in resource utilization and an increase in the maintenance complexity/effort also cause the costs to increase.
Although this example is for housing, the same ideas apply for software. In many ‘traditional’ situations, software is installed on the client side, either on their desktop or on a dedicated server:
For many customers, this is not an ideal solution, especially not for small companies:
- Cost: This solution requires a large investment, due to the requirement of an application server, database server, etc.
- Resource utilization: Many small businesses do their administrative tasks perhaps once a week, which means that their servers are idle during the rest of the week.
- Maintenance: For every software upgrade, all servers/installations must be upgraded individually.
As you can see, this approach is not very efficient for smaller companies. Luckily, we can apply the apartment principle to software as well. By letting multiple customers share the same application and database server, we can achieve the same benefits:
- Cost: As resource costs are much lower, software (or rather: a service, SaaS) can be offered to the customer at a much lower price.
- Resource utilization: All customers use the same application and database instance, which results in high utilization of these instances.
- Maintenance: All upgrades must be applied to one instance only, which results in lower maintenance costs.
In software engineering terms, we call this situation multi-tenancy:
Unfortunately, multi-tenancy also introduces some new problems and emphasizes some existing problems. I’ll elaborate more on these problems in a next blog post.