MongoDB & NoSQL (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
WiredTiger Storage Engine: Checkpointing, Cache, and Concurrency.
senior LevelMost AskedSystem Design
In Simple Words: WiredTiger is MongoDB's default storage engine:
- Document-Level Concurrency: Uses optimistic concurrency control; multiple concurrent write operations can update different documents in the same collection simultaneously without table/collection locking.
- WiredTiger RAM Cache: Holds uncompressed documents in memory (defaults to $50% \text{ RAM} - 1\text{GB}$).
- Checkpoints: Every 60 seconds (or 2GB of data), WiredTiger writes a consistent snapshot checkpoint to disk, ensuring recovery consistency in case of power failure.