Does WiredTiger of MongoDb has the performance iss

2019-09-10 17:19发布

问题:

As the MMAPv1 Document said

All records are contiguously located on disk, and when a document becomes larger than the allocated record, MongoDB must allocate a new record. New allocations require MongoDB to move a document and update all indexes that refer to the document, which takes more time than in-place updates and leads to storage fragmentation. Changed in version 3.0.0.
By default, MongoDB uses Power of 2 Sized Allocations so that every document in MongoDB is stored in a record which contains the document itself and extra space, or padding. Padding allows the document to grow as the result of updates while minimizing the likelihood of reallocations.

But the WiredTiger Document says nothing about this. So I just wanna know whether it is very ok when the record size changes or it has some performance issue but doesn't mention in the document.

回答1:

You do not have to worry about document movement, padding etc. with WiredTiger. New writes initially get written to files in unused regions and then incorporated in with the rest of the data in the background later. WiredTiger, during an update, will actually write a new version of documents rather than overriding existing data the way a mmapv1 does in many cases. (Check the video from MongodDB free online courses)