Multitenancy for dummies!

Aditi Jain

Intern, Essentia.dev

2023-08-30

What is Multitenancy?

Multi-tenancy is an architecture in which a single instance of a software application serves multiple customers, Tired of reading this everywhere and still don’t have an idea about what it really is and why it’s really important to build a SaaS(Software as a solution) application. Well don’t worry because I am going to make it really simple for you.

Let me introduced you to Garett, Garett is a diligent and passionate owner of a “Oaks vill” building. Garett currently has eight separate mail cabinets in his building’s reception area for each apartment, but he needs to install additional mailboxes for the upcoming two apartments. Managing and maintaining these mailboxes has become challenging and tenants have been complaining about certain mailboxes having extra features like separating ad mail from personal mail or some are painted much beautifully than others.

Garrett resolved the issue by installing a mailbox system with ten cabinets, each with a separate key card for individual apartments, and he holds a master key for accessing all the cabinets.

Voila! Problem solved.

Multi-tenancy architecture is similar to Garett’s situation. whenever we build a SaaS application it’s highly likely that we need to separate the users who can be individual users or a group of users, so as to implement collaboration and personalization simultaneously.

By implementing this architecture, customer data privacy can be upheld, while ensuring that each customer can fully leverage the application’s benefits.


Types of multi-tenancy

Multi-tenancy can be implemented in multiple ways by altering our application’s data structure differently each time.

  • Shared database with isolated schema: Database storing each entity’s data is shared whereas schema storing their database is different.
    This is how Garett in the above example solved his problem.
  • Shared database with shared schema: Database as well as the schema storing the database is common. As there are no separate tables for different entities, some conditions are applied to the table for storing data in an organized manner.
  • Isolated database with shared app server: In this approach we are keeping each tenant’s database into a separate database.

Multi-tenancy Vs Single tenant application

A single tenant application has a single instance of the software application and serves a single customer. There is no division in the applications’ database and hence no sharing of the application is taking place.

Single tenant approach is more preferable when our spending threshold isn’t creating a barrier and we are rooting for maximum security.
Also as there is a firm control over the entire system hence customization becomes really handy.

Whereas using multitenancy is beneficial when solution needs to be cost controlled and integration is a user requirement. All maintenance is in control of SaaS providers.

Real world applications of multi-tenancy

  • Google Apps: Google Apps leverages multi-tenancy to provide cloud-based productivity and collaboration tools to multiple organizations within a shared infrastructure.
  • Salesforce: Dropbox employs multi-tenancy to offer its cloud storage and file sharing services to millions of users in a shared infrastructure ensuring data isolation along with seamless collaboration.
  • Mailchimp: Mailchimp utilizes multi-tenancy to provide its email marketing and automation services.

Well now I guess we can all agree with the statement “Multi-tenancy is an architecture in which a single instance of a software application serves multiple customers”

Thankyou for reading…I hope this helped ;)


Written by: Aditi Jain Essentia.dev