Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum documents in one mongodb collection

Tags:

mongodb

What will be the maximum number of documents we can store in one mongodb collection? I have one million documents with around 100 fields to insert into one collection. So, is it good to use one collection or should I go for multiple collections?

like image 827
Sanjay Jain Avatar asked Aug 17 '15 14:08

Sanjay Jain


2 Answers

Unless you create a capped collection, there is no limit to the number of documents in a collection.

There is a 16MB limit to the size of a document (use gridfs in this situation) and limits in the storage engine for the size of the database and data.

If your documents do not exceed 16MB, then having 1 million of them will not be problematic for the mongodb storage engine limits.

like image 84
whyceewhite Avatar answered Oct 05 '22 13:10

whyceewhite


Yes. You can store more than a billion. The better your server hardware, the better the MongoDB performance.

like image 22
James Emmanuel Avatar answered Oct 05 '22 13:10

James Emmanuel