Written on May 7th, 2011 by Shamelle
I heard the word multi-tenancy about a year ago when it was brought up in a requirements meeting I was part of. While I can’t disclose the entire conversation, let’s just say one of the main requirements was, “This application should support multi-tenancy!”.
Since then my knowledge on multi-tenancy has grown (or so I’d like to think!) . As part of today’s blog post, I thought of writing an overview on Multi-tenancy to help anyone else, who’s hearing the word multi-tenancy for the first time!
What is Multi-tenancy?
Multi-tenancy refers to a principle in software architecture where a single instance of the software runs on a server, serving multiple client organizations (tenants)
For example (a simplified one!), let’s say there are 5 customers that require to use the same application. So instead of offering 5 copies of the OS, 5 copies of the database and 5 copies of the application, there could be 1 OS, 1 Database and 1 application on the server (note: Hardware resource capabilities may defer). Thus, the 5 customers would coexist within the application and work as though they had the entire application just to themselves.
Single-Tenant vs Multi-Tenant
Single-tenant has a separate, logical instance of the application for each customer.
Multi-tenant has a single logical instance of the application which is shared by many customers.
(reference: Developing Applications for the Cloud on the Microsoft® Windows Azure(TM) Platform (Patterns & Practices))
Multi-Tenancy Architecture Options in Windows Azure
Multi-Tenancy in Windows Azure is not as clear cut as it is depicted in the above figure. It can get a lot more complicated! Meaning, components in Windows Azure can be designed to be single tenant or multi-tenant.
You think that’s hard enough, think again. Even for databases there can be many options. Do you want to share the entire database and schema with all the customers, or perhaps have one database then then have separate schemas etc. There is a good article on MSDN, titled Multi-tenant data architectures, if you like more information.
All in all, the underlying infrastructure is shared, allowing massive economy of scale with optimal repartition of load.
Additionally, multi-tenancy allows for easier application maintenance since all application code is in a single place. It is much easier (and cheaper!) to maintain, update and backup the application and its data.
I will be writing more and may be even tryout some examples with windows Azure code for multi-tenancy. Stay tuned..