Is a lot of mongodb dynamic collections a bad thing for a project and have an effect on performance

Viewed 148

I am looking to start using MongoDB for a new project. I am running into the issue of planning where I believe I will have collections that go over the limit if stored together. After doing some research I discovered I could do dynamic collections but this will also end up making a ton of collections. Will this have long term issues on the application or is Mongo, okay having X(x could be thousands) number of collections as long as their size is small

1 Answers

With the Wired tiger storage engine, there is no limit on the number of collections you can create in MongoDB unless you're hit by some physical limitations on the resources.

  • Every collection you create results 1 file on a disk.
  • Evey index you create creates a file on a disk.

With these considerations, you're likely to hit by open files limitations(although you can increase them by scaling vertically your resources).

If the estimated # of collections are not too huge. This approach might work for you.

Read the following answer for more details about the pros and cons of the above approach:

MongoDB performances - how many databases, collections?

Related