- What is Multi-Tenancy?
- What main approaches to implement it?
What is Multi-Tenancy?
It is the application's ability to support the execution of several users or groups of users who have a connection and need it to work in a specific way. In general each one will have its separate data, its own settings, they work independently, but it is a running application. In general, this group of users can be a company that has contracted an application service. But it may be your browser that allows multiple users to use it independently without using one affecting the other.
As the name in English says, you lease a part of an infrastructure to you. Other parts of the same infrastructure are available to other people in isolation. Isolation is due to the way the application was developed.
The operating system usually works that way, at least in parts. As not everything is perfect like multitenancy, there are solutions like Docker . Databases work like this.
Virtualization, cloud, these things aren't usually considered multitenancy because the isolation is too great, it's almost like running on separate machines. But mostly there are separate instances, the isolation is not done by the application in question but by an external tool.
It is opposed to the application running in a completely isolated way for several users. If you do totally separate installations, even running on the same machine is not multitenancy .
But obviously it doesn't even have to be all on the same machine to be multitenancy , as long as the different machines work with more than one group of users in isolation. The fact that the application is distributed has nothing to do with the concept of multi lease.
In general there are different databases (no matter what this DB is, whether it's SQL, whether it's files and directories, Windows registry, etc.) for each user/group and code that knows how to handle it. You can't have something that does globally on the machine, because the machine isn't just one user.
If the application is not designed to work that way there is likely to be confusion. In general this requires a little more complexity in development because everything needs to be configurable according to the "customer" that is renting without disturbing the others, but it makes the deployment and physical maintenance of the environment easier, although upgrades can be more problematic.
Development maintenance needs to be done with a little more care because many situations are possible, especially when something incompatible is done. It gets worse when the "customers" have a lot of flexibility and can customize some things too much.
What main approaches to implement it?
I don't know if I can answer this, other than stating the obvious, that all resources need to be accessible according to some information that refers to which client is operating at that moment. This decision to get the data from which place can be made based on the login making, a configuration somewhere, a key, the location from which the access comes, or even the internet domain you are accessing, just to name a few.
If using a traditional database, it may be that all "customers" are in the same database and have a key to differentiate who belongs to that row. Or it can have different and completely isolated databases, which can give more possibilities to customize each one.
There are so many approaches, and some are so specific to the type of application that it would be difficult to name. I mentioned application examples that many people do not realize is multitenancy , each one has its approach, whoever understands how they work must understand how each one works.
The system that uses this is multi-tenant.