Best Practices for DAL and Configuration on an Isolated Multi-Tenant Database

My company has a dozen sites and isolated databases (identical schemes). Each client has its own website (another application pool) and a database.

Each website has its own configuration, several connection lines, but they all have the same scheme for configuration.

cust1.domain.com

cust2.domain.com

cust3.domain.com

We would like to combine all the websites into one (one application pool) and stay with isolated databases for security and a lot of reasons for the data.

What is the best practice for developing a DAL and its configuration? What are the consequences of this if a large number of tenants are at the same time? can one application pool manage this situation or can it be managed somehow?

By the way, we use asp-membership to authenticate users.

Thanks in advance, Eddie

+6
source share
3 answers

Use the Application_PostAuthenticate event in global.asax to load the desired database, and then close the connection in Application_EndRequest

0
source

One option is to use a membership profile and store some of the information that will allow you to determine which of the actual db they should be connected to. The disadvantage is that you will need to store this information for the entire user session so that either the cookie or session variable is needed.

The consequences of a single site are largely dependent on your environment and application, do you currently have multiple sites in one window, or do you have a web farm? Do you know the number of simultaneous users for each site, the amount of traffic? A performance monitor can help you find out how busy each site is, but you may need to use more invasive logging to determine metrics like concurrent users. I found this server error question regarding IIS 7 performance, which might help

0
source

You can try "Collaborative database with a different schema" from a multi-user data architecture. In your DAL, you can select a specific scheme that is perticular for the current user. Simple and safe this way

Continue reading http://msdn.microsoft.com/en-us/library/aa479086.aspx

0
source

All Articles