views:

536

answers:

1

I'm in the process up changing a single SQL DB website (ASP.NET/VB.NET) into a multitenant app, where each client has their own database.

In the old site, all the ASP roles, logins and providers pointed to the single database.

Now we have multiple databases, I'm wondering what would the best architecture/techniques to use. There is one database that configures the tenants, such as the company name, various settings (that would normally be in a web.config) and the connection string to their tenant database.

Should we have all the membership & role stuff in the single database that configures the tenants or do we have membership & roles in each individual tenants database? Option 2 seems tricky because I think ASP.NET only likes one set of RoleProviders defined in the web.config.

Has anyone tried this before or got any recommendations?

+1  A: 

if your using the ASP.Net membership model with the built in providers then putting them into one DB is the easiest as you indicated.

One option and I've not tried this is to define in your web.config file a provider for each tenet, this would allow each tenet to have their own membership db, and allow you to avoid username collisions btw the tenants (If this is a requirement).

JoshBerke