Problem Statement
Which storage engine is the default in MongoDB 3.2 and later?
Explanation
WiredTiger became the default storage engine in MongoDB 3.2, replacing MMAPv1. WiredTiger offers significant improvements including document-level concurrency control, compression, and better performance for most workloads.
WiredTiger supports multiple threads writing to different documents simultaneously in the same collection, unlike MMAPv1 which used collection-level locking. It also provides data compression using snappy or zlib, reducing storage requirements and improving I/O performance.
Code Solution
SolutionRead Only
// Check current storage engine
db.serverStatus().storageEngine
// Output:
{
name: "wiredTiger",
supportsCommittedReads: true,
persistent: true
}
// WiredTiger features:
// - Document-level concurrency
// - Compression (snappy default)
// - Checkpoints for crash recovery
// - Write-ahead logging (journaling)