Practical limit for the number of databases in SQL Server?

20,787

Solution 1

Technically the limit of databases per instance in SQL Server is 32,767, but I doubt that you could use a SQL Server instance that has more than 2,000 databases, at that point the server would probably be not responsive.

You may be able to have close to 30,000 databases if they were all auto-closed and not being used. you can find more information about capacity limits here:

Maximum Capacity Specifications for SQL Server

Solution 2

Joel has talked about this at another place (sorry, no reference handy) and said that before switching to MS SQL 2005 the management console (and the backend) had problems attaching more than 1000 or 2000 databases. It seems that 2005 and probably 2008 again improved on these numbers.

As for all performance questions are always dependent on your actual hardware and workload an can only definitely answered by local benchmarking/system monitoring.

Solution 3

I'd think mostly it depends on the memory limitations of the machine. SQL Server likes to keep as much cached in memory as possible, and as you add databases you reduce the amount of memory available.

Solution 4

In addition, you might want to consider the number of connections to a SQL Server. After 500-1000, it gets very cloggy and slow. So that is a limitation as well.

Solution 5

I think it is more a question of the load on the databases. As was said above, if there is no load then 32,767. With a high load then it comes down, eventually to 1 or less than 1.

Share:
20,787
Aaronovitch
Author by

Aaronovitch

Ummm...I really just wanted to get another badge :)

Updated on January 28, 2020

Comments

  • Aaronovitch
    Aaronovitch over 4 years

    In one of the stackoverflow podcasts (#18 I think) Jeff and Joel were talking about multi vs single tenant databases. Joel mentioned that "FogBugz on Demand" used a database per customer architecture and I was wondering if there is a point beyond which you'll need to have multiple database servers to distribute the load?

  • Beep beep
    Beep beep about 10 years
    We have 2,300 on ours and it works like a charm, although we never have more than about 100 open at any one time.
  • Mark
    Mark over 8 years
    Sorry to comment on old discussion. In the attached link it said "User databases per instance of SQL Server, including data-tier applications = 50". It seems very limited. Am I misreading it?
  • AaronHS
    AaronHS over 8 years
    That's under "The following table specifies the maximum sizes and numbers of various objects that were tested in the SQL Server Utility." heading. Under "Database Engine Objects" the "Databases per instance of SQL Server" is 32,767. The table you're looking at represents what was tested with SQL Server Utility, not what the maximum limit it
  • MaxiWheat
    MaxiWheat almost 5 years
    Commenting too on an old post, we have 12,000+ running in a SQL Server 2014 Standard. Works great, load is pretty light on individual databases. However, some tools have a hard time working with such amount of databases (We use SQL Multi-Script to deploy database changes and it's kinda slow building the distribution list)