Tuesday, 31 May 2011

Multi-Tenant Architecture

As SaaS (Software as a service) takes big steps in these days, lots of new methods or rather less used methods are getting more attention. Making an application truly Multi-tenant is one of the key feature in SaaS. In xEvents, we made the application multi-tenant capable in the initial phase of the project to reduce incremental time and cost factor if we converting into multi-tenant based application in the later stage. We had lots of discussions going back and forth to make right design decision for implementing the multi-tenant enabled platform which is more suitable for xEvents application. We thought it is worth to post here on this topic.

Possible Design solution: One of the Key factor while designing the multi-tenant design is the database design. As we will be intent to store all the tenant data in our server and mostly same set of application code will be accessing different tenant data, designing suitable database structure turned out to be a tricky call. In a broad category, we can implement in 3 different ways:

1. Isolated database for each tenant
2. Isolated schema for each tenant
3. Shared schema for all tenants

Though i have stated three different individual type, it is a continuum spectrum. Most of the time we need to choose a mixed approach (for e.g. sharing few tables/schemes across the tenant and also few separate table per tenant). Meaning, choosing the correct type is fully depends on type of application.

(source: http://i.msdn.microsoft.com/dynimg/IC150005.gif )

Few worth noting factors while making the design decision : No. of Tenants, customization required per tenant, Scalability, database size / maintenance cost, No. of users per tenant, data privacy/isolation issues. This[1] article clearly listed the pros and cons with a detailed analysis.

Multi-tenant grails plugin: Once we are clear with the design in our mind and having grails powered by plugins, now we have to pick-up the right plugin and fine-tune the configuration as per the our requirement. Multi-tenant plugin[2] provides out of box implementation for multi tenant based applications. Though, this is not clearly (rather fully) documented, this page[2] will give you a very good idea to start with and about how this plugin works. Here is our few cents:

1. Although, this plugin suppose single database per tenant, it is little immature as of now[June,2011].
2. There is another version of this plugin[3] (using Hawk Eventing and Hibernate Hijacker) to support single db per tenant. But this is still in the experiment mode.
3. This plugin have incompatibility issue with searchable plugin. we tried few suggestions given in forums to fix this issue, but in vain. (Though, i am not sure of the fact, but this might be because both the plugins modify the datasouce in the beginning or because of the subscription to the hibernate events).
4. Need to be careful about having common pages like admin page which will access data across the tenant. It is not available out of box from this plugin.

[1] http://msdn.microsoft.com/en-us/library/aa479086.aspx
[2] http://multi-tenant.github.com/grails-multi-tenant-core/guide/index.html
[3] http://multi-tenant.github.com/grails-multi-tenant-single-db/docs/v0.7.2/guide/


  1. Thank you for the good article.
    When it comes to the cloud services, Multi-Tenant Architecture plays the really important role. Regarding the virtual data room providers' experience, I can say that there shouldn't be any issues when dealing with huge amount of clients.

  2. "Multi-Tenant Architecture " - it's very interesting, and y need to understand how it works.
    Thank y for this post, now it's all clear for me.

  3. One of the Key factor while designing the cargo bandung papua multi-tenant design is the database design.

  4. Thank you for sharing with us such a great blog. I would like to share my experience with you as well.
    I'm an author on the travel blog and I travel around the world a lot
    delta airlines telephone number customer service
    south west phone number in spanish
    air canada customer service phone number
    alaska airlines visa customer service phone number

  5. Search Engine Optimization takes the rank of your site on the next level. SEO is indeed essential since, without it, your website cannot survive. SEO works wonderfully to any location.
    Content Writing Company in Delhi
    Content Writing Services in Delhi
    Mobile App Development Company Delhi
    PPC Company in Delhi
    PPC Company in India

  6. Thanks for sharing such a nice Blog.I like it.
    webroot contact number

  7. Are you looking for professional plumber melbourne? Mako Plumbing Services offers the best plumbing services for all your blocked drain melbourne needs!

  8. Hi Very Nice Blog I Have Read Your Post It Is Very Informative And Useful Thanks For Posting And Sharing With Us.
    Office Cleaning Melbourne | Carpet Cleaning Melbourne

  9. Hi Very Nice Blog I Have Read Your Post It Is Very Informative And Useful Thanks For Posting And Sharing With Us.
    Bond Cleaning Melbourne | End of lease Cleaning Melbourne

  10. Thanks for sharing this content. This is more informative and effective to all the individuals.
    catering melbourne
    finger food catering Melbourne

  11. Thanks for sharing the information with us. Keep on updating us regularly.
    Bpo Companies in the Philippines | Offshore Staffing Philippines

  12. Finding freelance jobs for engineers is easy, but making sure the role is suited for your field and getting the job is the tricky part. You need to make sure that the post is related to what you do because if you pick up a wrong position that you do not understand and need to turn down later, it will give your employer a false impression and you will lose credibility in the market. Freelance VOIP Engineers

  13. Design previously, SEO Company Dubai developed out of the elements between needs (cover, security, adore, and so on.) and implies (accessible structure materials and specialist aptitudes). Ancient and crude engineering establish this beginning time. As people advanced and information started to be formalized through oral conventions and practices, engineering developed into an art. Here there is initial a procedure of experimentation, and later ad lib or replication of an effective preliminary. The planner isn't the sole significant figure; he is simply part of a proceeding with convention.

  14. Engineering initially, website development packages in dubai advanced out of the elements between needs (cover, security, love, and so forth.) and means (accessible structure materials and chaperon aptitudes). Ancient and crude engineering comprise this beginning time. As people advanced and information started to be formalized through oral customs and practices, design developed into an art. Here there is initial a procedure of experimentation, and later act of spontaneity or replication of a fruitful tria.

  15. I suggest you study, Pakistani Mehndi Dresses architecture as your main field and get a second degree in program or those that have a degree in something other than architecture and now learning it in a separate 2-year.

  16. It is extremely great to see the excellent information presented in an easy and understanding manner. Thank you for sharing this with us.
    Best Home Work Helper

  17. I am feeling so much proud that I have found your website. If you guys want to deliver all your assignment within the stipulated time and seeking online assignment help service providers then hire online assignment writer of SourceEssay.

    Instant Assignment Writer
    Online Assignment Help Germany
    Dissertation Assignment Help

  18. Our
    homework help service are always there to help you out in your academic work.Get the assignment help you deserve from one of the best writing services online!

    homework help

  19. We offer translation service and localize into 200+ languages. We provide Legal translation services Singapore based top-notch translator experts who are working with universities and other tertiary institutions as well as multicultural organization in Singapore

  20. That’s very kind of you to deliver such an incredible article, which seems courageous and mindful.I appreciate you for the thoughtful content which is elegant and more perfect.Awaiting for your next post. Web Designing Course Training in Chennai | Web Designing Course Training in annanagar | Web Designing Course Training in omr | Web Designing Course Training in porur | Web Designing Course Training in tambaram | Web Designing Course Training in velachery

  21. It's very useful article with inforamtive and insightful content and i had good experience with this information.Enroll today to get free access to our live demo session which is a great opportunity to interact with the trainer directly which is a placement based Salesforce training India with job placement and certification . I strongly recommend my friends to join this Salesforce training institutes in hyderabad practical course, great curriculum Salesforce training institutes in Bangalore with real time experienced faculty Salesforce training institutes in Chennai. Never delay to enroll for a free demo at Salesforce training institutes in Mumbai who are popular for Salesforce training institutes in Pune.


Copyright David Bourget and University of London, 2011. This blog's content is license under the Attribution-ShareAlike license.