Does WiredTiger of MongoDb has the performance issue of reallocation as MMAPv1

隐身守侯 提交于 2019-12-11 06:23:26

问题


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)



来源:https://stackoverflow.com/questions/38543434/does-wiredtiger-of-mongodb-has-the-performance-issue-of-reallocation-as-mmapv1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!