Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-414

FAQ: With the advent of 2.2 and db-level locking, what are the implications of having one collection per database?

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • Server_Docs_20231030
    • Affects Version/s: None
    • Component/s: manual
    • Labels:
      None

      Separating write-heavy collections into distinct databases will take advantage of DB-level locking, and that it will cost you some disk space due to preallocation.

      Potential downsides to putting every collection in its own database:

      • The listDatabases command, used by MMS and other tools, will become slow if you have hundreds or thousands of databases.
      • MMS's DB stats collection will put additional load on your system if you have many databases; MMS will collect stats less frequently in that case. It will refuse to collect stats on more than 100 databases.
      • Preallocation, although it's done in the background, is still an operation that competes with others for resources; the more databases you insert into the more common preallocations will be.

      In conclusion, probably better to keep the number of databases in the dozens, not hundreds, and separate collections into databases judiciously.

            Assignee:
            Unassigned Unassigned
            Reporter:
            barrie Barrie Segal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              11 years, 38 weeks, 5 days ago