Monday, September 26, 2011

Multi Tenancy in Your Application

A year back I was working on one of my project and I was developing it as a multi tenant application. At that time I had not done enough research in the field of multi tenancy and using my common sense I had a multi tenant system with “shared database and shared schema” approach. I learnt many things while working on this pet project but then I closed it because of laziness.

Recently I tried to put more thoughts on multi tenancy. One reason behind this is that recently I came across of several miss-selling cases of Sharepoint 2010. Sharepoint 2010 was pushed down the throat of customers just because of it was a multi tenant system and if you need multi tenancy in your application, just build your application as a Sharepoint 2010 application. Why? Why on earth would I employ a Sharepoint just for a simple multi tenant application? You can say simple multi tenant application is oxymoron but I won’t argue on that. Smile

Multi Tenant Data Architecture is a good read on the topic of achieving multi tenancy at the level of database. Then there are some blog posts by some mature software architects. Multi Tenancy – Approaches and Applicability is a nice collect of several blog post by Ayende Rahien. He talks about Physical Data Model and Extensible Data Model. My view of extensible data model is that you need to make your data model extensible only if you have some serious plans for your application. Even if you don’t start with extensible data model in mind but have opted either separate database or separate schema approach, then you should be able to achieve it at a later date as well. Shared schema approach is what will prohibit you to go for extending data model for each tenant. Ayende also talks about Extensible Behaviors, Development Structure and keeping all this really simple. By looking at all this IoC comes as a critical component that you need to employ in order to build a multi tenant application. Ayende also takes a dig at the article I suggested on multi tenant data architecture.

This is it for now on multi tenant application and I am strictly against using Sharepoint to achieve multi tenancy. I would better roll out my own implementation instead of employing Sharepoint 2010 in this particular case.