Reputation: 1351
I'm looking for your inputs to the following questions regarding an MVC3 application and multi-tenancy.
1) Do you use a single application instance with multiple databases - one per client?
2) Or do you use a single application + single database instance - with some data (say vendor ID) to distinguish the vendor's data?
If it is case one above - one application + multi databases - how do you configure your web.config? How do you point your application to the correct database when the user logs in?
If it is case two above - how easy are you finding it to do the following - customizations per client - backups and restore for a single client
Has anybody just gone with a single-tenancy architecture for your cloud application? How does it compare in terms of ease of adding new clients, number of database instances, prices etc?
Sorry, lots of questions, but something I am really trying to research on before I make my decision. Looking forward to all your inputs. Thank You
Upvotes: 1
Views: 844
Reputation: 1220
Unfortunately, there is no "open source" project or good "example" of setting up multi-tenancy as something "stand alone" in MVC 3 that I have found (someone please correct me if I am wrong).
Most examples I found via Google focus on one aspect and are more theoretical. Still others are older (focusing on MVC 2). I have been searching high and low for a good solid project that I can use to do what I require that's just bare bones multi-tenancy.
Now, if you need an MVC 3 example (assuming you can open something up and look through the code to understand), then I would recommend Orchard CMS's Multi-Tenant module. If you are able to look at the code it should give you solid examples of how to accomplish what you want (assuming you are designing something).
In Orchard each "tenant" has its own SQL Compact database, but you can configure it to run SQL. So it's one application with multiple databases. All configuration is done through an Admin interface (so no messing with the web.config). And it handles "pointing" to the right database.
It's a multi-step process setting up (a combination of the Admin interface and bindings / http redirects in IIS), but easy to do once you get the hang of it.
Upvotes: 3