How I Introduced Multitenant Architecture In my Web Application

I am all in one kind of guy, I have always wanted to create a software which had little (or more :)) bit of many things. So I started building a webtop solution of my own. As you can quickly see I get to work on a great webapp in which I can integrate a variety of mini applications (All In One). As it happens with any project, even the fun ones, you get to sit down and draw all the beautiful diagrams capturing bits and pieces of the system. During this process I soon realized that I can turn my webtop into a money mongering machine by selling it to many users (definitely more than a billion users would log into my application and make me rich, after all who can resist it :)). So immediately my initial design took a wider berth as it has to include the good ol Multitenant SaaS architecture into consideration.

For people who are into stingy definitions here are couple

Software as a service (SaaS, typically pronounced [sæs]), sometimes referred to as “on-demand software,” is a software delivery model in which software and its associated data are hosted centrally (typically in the (Internet Cloud) and are typically accessed by users using a thin client, normally using a web browser over the Internet.

Multitenancy refers to a principle in software where a single instance of the software runs on a server, serving multiple client organizations (tenants).

Ok, you all correctly guessed I stole the above definitions from wikipedia. But give me a break I am not a genius, I cant create definitions on my own so give it a rest. In lieu of above definition let us ponder a bit on what multitenant Saas Application has to offer.  Since many users share same application instance hence there is a

  1. Increased resource utilization  
  2. Decreased cost in Delivering the service.
  3. Easily manageable
  4. Decrease in hardware cost which can be installed on-demand.

Design considerations for a Multitenant SaaS application.

Designing the Multitenant Webtop was very fun and satisfying and off-course not so easy. There are tons of architecture, methods and what not on web and the available on the net, also the existing books are not easy to decipher. After reading much I arrived at following design aspects I had to take care in my webtop.

  1. On Demand Scalibility – Since many users access a single instance of application hence the application should be easily and higly scalable. And on top of that SaaS provides should have a facility to scale easily when demand on system grows.

  2. Data isolation – For many industry ciritical SaaS application, like payroll SaaS for instance, The data security is of critical importance hence there is a need of isolating data between multiple tenants.

  3. High Degree of configurability – Each tenant has their own set of taste for look and feel, also there are set of configuration data, like smtp for instance, that are solely relevant to user. Hence it is pertinent for any SaaS application to go an extra length to provide user configurable version of application.

  4. Security – It is quite obvious that any tenant would not like other users to be accessing and messing up with their data. Hence a security becomes unarguably one of the most important architectural component of a SaaS application.

    If multitenancy was a person then we would look something like this.

    multitenant man

    Figure 0:  Multitenant Man

It is easy to write in one paragraph all this on-demand scalability, security blah, blah. But how do we go in about achieving it.  I will try and lay down some general rules on how to achieve this but not in this post. For that you have to wait for my future posts (can’t put everything in same bucket). For time being I will just tell you about technologies I will be using for my multitenant webtop application. I am a java guy hence I am biased towards using java technologies.

  1. Web Layer – Struts 2,  Tuckey’s UrlFilter,  jquery pluggin, sitemesh
  2. Business layer – Spring
  3. Database layer – Hibernate and Hibernate shards
  4. Security – Spring Security.
Over next few posts I will be outlining how the above technologies were mixed and used to make my webtop multitenant. I will also be commenting on general topics on how to achieve scalability  etc. So for time being bye bye 🙂 

Print Friendly, PDF & Email

About Niraj Singh

I am CEO and CoFounder of a startup "Aranin Software Private Limited, Bangalore. I completed my graduation in 2002 as an Aerospace Engineer from IIT Kharagpur. I love working on new ideas and projects and recently released my first open source project JaiomServer "". I have 9 years of experience in IT industries most of which I have spent in developing community applications for various clients using java. Some of the sites in which I have actively involved with are,,,, etc.
This entry was posted in Cloud Computing, Multitenancy and tagged , , , . Bookmark the permalink.