Explain the role of the WiredTiger storage engine in MongoDB.
Instruction: Provide an overview of the WiredTiger storage engine and its impact on MongoDB performance.
Updated
Official answer
WiredTiger is MongoDB's default storage engine. It manages stored data, indexes, cache, compression and recovery. It supports document-level concurrency, allowing operations on different documents to proceed concurrently, but this is not a promise that writes never contend.
For most reads/writes, WiredTiger uses optimistic concurrency control with broader intent locks. Conflicting work can produce write conflicts and retries. It also uses multiversion concurrency control to provide snapshots; long-running operations and transactions can affect retained history and resource use.
Checkpoints and journaling support crash recovery. Compression reduces some disk/I/O costs at a CPU cost, with effectiveness depending on data and configuration. Both the WiredTiger cache and the operating system's filesystem cache matter, so increasing the internal cache blindly can hurt the overall system.
Assess throughput, latency distributions, cache eviction, dirty data, disk latency and write conflicts under representative load. A hot document or poor index can still dominate performance. Comparisons with an obsolete storage engine do not establish a benefit for a particular current workload.