0

Suggestion Needed for Server Architecture for Single Code Base Multiple sub-domain (Multi tenant architecture) MVC .NET.

Introduction Working on creating MVC .NET Web based application, which will be connected to different DB , based on Sub-domain name. 2k Accounts , will have approx 100 users each.

Finding the best architecture suggestions to handle this.

Description - Account / Sub domains count will be 2K or more. - Each Account will contain approx 100 users. - Database will be MSSQL, each subdomain will have different db connection.

May i request you to help / expert feedback in below questions,

Questions

  1. Type of URL structure which will suite best for above requirement. Logic 1 Or Logic 2 OR Logic 3, which is the best ?

    enter image description here

  2. How server can withstand this many responses ? Do this is related to Application pool in .NET ? Please advice more on this. 2000 Subdomain X 100 Users = 2,00,000 Requests , one code base can handle this many requests ?

  3. Logic 1 Or Logic 2 OR Logic 3, which is best to implement ? What is advantage to one over other?

  4. Google / Facebook etc handling single domain with multiple servers.Is this is the best industry standard ?

  5. As we know , Logic 1 , we can set multiple Application Pool for each Sub domain , will this be applicable for Logic 3 as well ?

  6. Considering Logic 1 and Logic 3 , which is the best and why ? when there will be too much load on web server , we need to add another web server at that time which Logic will be best suitable?

Sharing the points which is known,

  1. We can add different application pool for different sub domains.
  2. APP server should be high end server to manage this many requests.
  3. Need to add load balancer when load / traffic on server increases.
  4. Need a best approach , expensive infrastructure also can be considered.
Pragnesh Karia
  • 509
  • 2
  • 6
  • 14

1 Answers1

2

Url structure is really irrelevant here (as long as it is not "Logic 3" -- just don't expose your "database name" in query strings). Beware, though, that if you go the "subdomain for each customer" way, you will have to purchase a wildcard SSL certificates, and these are a bit more expensive. Plus, IIS still does not support wildcard subdomains, so there will be quirks in setting things up. Other than that, either option is fine.

Load balancers are pretty much a must these days. On the other hand, I would not invest in "high end" hardware. A couple of middle-of-the-road servers will be more than sufficient. What you should be worrying about is getting these 200,000 users.

Regarding database schema, see the Multi-Tenant Data Architecture article on MSDN. Basically, there's no single right answer. Each option comes with its own sets of benefits and downsides.

Single "code base" (as in, single instance of an application) can handle as much databases as you wish. The only limit here is SQL Server itself. Maximum Capacity Specifications for SQL Server says that the maximum number of "Databases per instance of SQL Server" is 32 767, but whether it's practical or not is debatable.

Community
  • 1
  • 1
Anton Gogolev
  • 113,561
  • 39
  • 200
  • 288
  • This information is really helpful. Please provide your opinion if single code base can serve the multiple databases ? lets say 2k database with single code base.? – Pragnesh Karia Aug 04 '16 at 11:54
  • @AntonGogolev- Modified the question , as i have found one more scenario in comparison. Please advice. – Pragnesh Karia Aug 09 '16 at 16:29