Why dataSize is larger that storageSize on MongoDB


#1

Hi,

I executed db.stat on my MongoDB database then I notice that dataSize is larger that storageSize which is very weird since the the storageSize containt the dataSize plus the size of other files.

Can somebody help me to understand?

I’am using MongoDB 3.4

Best Regards


#2

HI,

If you are using wiredTiger storage, then by default the compression is automatically activated.
That is why the dataSize can be larger that storageSize because the storageSize is a compressed size.