Mongodb – How MongoDB allocate new data block when data block is full

mongodb

I am using MongoDB in my project. And I have some questions about how Mongo storage allocated.

For example, I have 16MB full data block, and I want to add new document into this data block. – How MongoDB allocate new data block ? – Will MongoDB move all data or only new document into a new data block ?

Best Answer

The maximum BSON document size is 16 megabytes but to store documents larger than the maximum size MongoDB uses GridFS

as stated in other answer about size of the first file 64MB and size of new datafile that keep on getting double till the size of newly created file reaches to 2GB. Have a look at Mongo db data file

enter image description here