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
For SQL Server, the max number of databases you can have on a single SQL Server instance is 32,767.
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*
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.
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.
(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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With