Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum number of databases in sql server 2008

We are writing an ASP.Net/C# based program that will potentially be accessed by a number of companies (each having separate login and data). We are thinking of having multiple sql server 2008 databases (same instance), each for one company. However, the c# program that accesses the database will be the same and will create appropriate connection string based on the database the customer will be accessing.

How many such databases can be created in the single instance of the sql server before seeing any performance degradation due to:

  • Limit on the connections, because each connection (not sure if it will be pooled for accessing different databases) is created using a differents connection string.

  • Limit on the number of databases, is it limited by the hardware or sql server 2008 will show degradation when the number of databases increases to say 100?

Anything else I might be missing?

Thanks for your time

like image 310
Samuel Avatar asked Jun 28 '09 01:06

Samuel


People also ask

What is maximum number of databases in SQL Server?

For SQL Server, the max number of databases you can have on a single SQL Server instance is 32,767.

What is the maximum size of database in SQL Server 2008?

Microsoft SQL Server 2008 Express edition has a database size limit of 4 GB* Microsoft SQL Server 2008 R2 Express edition has a database size limit of 10 GB*

What is the limit of database?

A Database Limits Limits exist on several levels in the database. There is usually a hard-coded limit in the database that cannot be exceeded. This value may be further restricted for any given operating system.

What is the limit of number in SQL?

The SQL LIMIT clause restricts how many rows are returned from a query. The syntax for the LIMIT clause is: SELECT * FROM table LIMIT X;. X represents how many records you want to retrieve. For example, you can use the LIMIT clause to retrieve the top five players on a leaderboard.


2 Answers

  • Max databases per SQL Server instance: 32,767
  • Max User connections: 32,767

(From here: Maximum Capacity Specifications for SQL Server)

Both are practically limited by the amount of RAM the SQL server machine has, long before it reaches those maximum values.

Of the two, I suspect user connections are going to be the bigger problem if you have thousands of users (as you are not using connection pooling).

To find the SQL Server machine's current value:

SELECT @@MAX_CONNECTIONS AS 'Max Connections'

Updated in response to poster's comments:
It's not really the number of databases that is the problem, but more the number of frequently accessed pages in those databases. If all the 'hot' pages fit into memory (and very few physical reads occur) then all is good.

like image 189
Mitch Wheat Avatar answered Oct 06 '22 09:10

Mitch Wheat


You should also keep in mind that connections will be pooled by connection string -- in your case, you will get separate pools for each Customer DB. That might not be bad if you have high traffic for each customer, but if you have low traffic to lots of different databases you will not get the full benefit of pooling.

like image 41
JP Alioto Avatar answered Oct 06 '22 08:10

JP Alioto