Skip to main content

How do frequent updates cause document movement and why is it bad?

Senior MongoDB
Quick Answer When a document grows beyond its allocated space (due to updates adding new fields), WiredTiger must move it to a new location. This movement updates the index entries pointing to the document. Frequent moves cause index fragmentation and more I/O. Mitigation: pre-allocate space by using $set to set fields to null initially, or use padding. Schema design to avoid document growth prevents this.

Answer

Document growth beyond allocated space triggers relocation, causing fragmentation and increased index maintenance.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice