How is the data in a MongoDB database stored on disk?

A given mongo database is broken up into a series of BSON files on disk, with increasing size up to 2GB. BSON is its own format, built specifically for MongoDB.

These slides should answer all of your questions:

http://www.slideshare.net/mdirolf/inside-mongodb-the-internals-of-an-opensource-database


MongoDB stores the data on the disk as BSON in your data path directory, which is usually /data/db. There should be two files per collection there, collection.0, which stores the data (and that integer is then incremented as needs be) and collection.ns which stores the namespacing metadata for the collection.


Detailed documentation of the BSON format can be found here: http://bsonspec.org/


Up to mongodb 3.0 http://blog.mongolab.com/2014/01/how-big-is-your-mongodb/ If you turn on wiredtiger storage engine in MongoDB 3.0 it will use wiredtiger storage model http://docs.mongodb.org/v3.0/core/storage/#storage-wiredtiger