WritingScalewayScalewaypublished Jul 21, 2022seen 5d

SaaS Solutions - What is the difference between a multi-instance and a multi-tenant architecture

Open original ↗

Captured source

source ↗

SaaS Solutions - What is the difference between a multi-instance and a multi-tenant architecture Build • Louis Moreau • 21/07/22 • 7 min read

Reminder: What is SaaS?

Before delving into the subject, it may be interesting to recall what a SaaS solution is: SaaS stands for Software as a Service. This is a method of distributing software that typically involves a subscription model to access a product, tool, or service.

With a few exceptions, these software is hosted in the cloud and can be accessed directly from a browser or mobile device, which greatly increases accessibility.

New ways of consumption:

In order to use an application or software, it was traditionally necessary to install it on its application servers. To do this, you had to have one or more employees in your company able to manage all layers, from networking to maintaining the application itself. Above all, it was often necessary to possess the infrastructure.

Then came the concepts of IaaS hosting (Infrastructure as a Service) and, a little later, PaaS (Plateform as a Service). These new ways of consuming IT resources have provided a layer of abstraction and simplification to deploy and install our or our customers' software. It is in this line of new ways of consuming IT conveniences that SaaS was born.

The problem is then simple: Allow my client to use simply my software.

No need to install it, manage updates or maintain the infrastructure.

iaas-paas-saas-2

SaaS Architectures

SaaS solutions are mainly built on two types of architectures:

Multi-instance on one side and multi-tenant on the other.

“Tenant” refers to the team or organization of your customers.

We won't see them here, but there are also architectures such as single-instance, multi-instance with shared database or flex tenancy that are a little less common.

diagram-multi-tenant-vs-multi-instance

The purpose of this article is not to take the side of a particular architecture because each architecture meets different needs. So the idea is to be able to compare the two types of architecture so you can choose the one that best suits you based on your needs and those of your clients .

Note that the result will not be much different for the end user. However, it will vary greatly in the design of the system architecture, data and access, and in the configuration and management of users.

So let's look at the pros and cons of each of them starting with multi-instance architectures:

Multi-instance architecture

multi-instance-1

In a multi-instance architecture, several companies will run their own separate instance of the application, with their own database. Each company will therefore have access to its data separately from another.

This type of architecture provides the following benefits:

Data Isolation :

Each organization (or team) has its own database and infrastructure. This results in total data isolation and offers a guarantee of confidentiality for your customers. Hackers will therefore have less interest in attacking your system because they will be less interested in recovering access from a small segment of your total data.

Simplified scalability :

Increasing resources is easier for a customer because only its infrastructure will need to be modified. We will be able to allocate more CPU, RAM or storage according to their needs.

Increase in overall availability :

If an instance fails for some reason, this issue will not affect all of your customers.

Personalisation :

Each of your customers can receive customizations of your SaaS (dedicated features, scheduled updates, etc...) that you can easily turn into business arguments.

However, since no architecture is perfect, we will still note the following negative points:

More complicated to deploy and maintain :

As you understand, each of your customers has their own dedicated infrastructure, you will need to provision each infrastructure, maintain it and update it separately.

Higher total cost :

This choice of architecture is less cost-effective when it comes to creating and configuring each environment such as the database or application because costs are not shared.

Multi-tenant architecture

multi-tenant-1

Now let's look at another type of architecture, the multi-tenant. Here several companies will use a single instance of the application (which can of course be replicated if needed), with a single database. This architecture does not give much flexibility but simplifies the process of adding features and fixing code bugs.

Major advantages:

Better profitability .

Using the same infrastructure and resources will cost you less because the resources will be shared between your customers.

Simplicity related to shared infrastructure.

Since there is only one infrastructure, it is easier to maintain.

Save time :

This type of architecture has the advantage of being simpler to set up than a multi-instance architecture. This makes it easier to develop your SaaS application and requires less time and resources to maintain it.

Always up-to-date :

Updates will only be done once so that they will benefit all of your users.

Disadvantages:

Shared database :

Any action affecting the database will affect all shared clients.

So it is at the application level that data separation will have to be done and therefore the developer team will prevent data exposure from one customer to another, which will increase the complexity of the application layer.

Any security breach has a massive effect because it will affect all users of the system.

Less customizable :

You will be less easily able to customize the offer you offer to your customers. It is still possible to lock some features in the code of the application but again, it may lead to complexity related to development.

Which architecture to choose?

You now have the cards in hand to understand the differences between the two types of architectures.

To summarize, for my part, if I had a “fast time-to-market” problem and need to quickly develop a SaaS solution, I would rather focus on a multi-tenant architecture because it is easier to set up. On the other hand, if I needed to develop a more robust and secure solution, I would instead opt for a multi-instance architecture and benefit from total data isolation.

To go further, build your architecture with Kubernetes

Kubernetes has the advantage of allowing you to build a multi-instance architecture as well as multi-tenant architecture. You will…

Excerpt shown — open the source for the full document.