Database field guide · 20
WiredTiger Storage Engine
Pages, checkpoints, MVCC, and MongoDB persistence
A physical model of how MongoDB uses WiredTiger for B-tree storage, cache management, compression, checkpoints, and durable history.
Franck Pachot7 chaptersMongoDB · WiredTiger · MVCC · checkpoints
Build the mental model before choosing the mechanism.
This minibook was AI-generated from Franck Pachot's archived blog posts. Links to the original articles are included for source context and verification.
01
Collections become WiredTiger tables
MongoDB maps collections and indexes to separate WiredTiger table URIs backed by .wt files. The catalog connects logical namespaces and idents to those physical objects.
- A collection and each secondary index have distinct storage objects.
- The size of a .wt file is not the logical document size.
- Use catalog metadata rather than guessing filenames.
02
Pages move through a private cache
WiredTiger reads and reconciles B-tree pages in its own cache. MongoDB's process memory therefore includes cache pages, engine metadata, sessions, and memory outside the configured cache.
- Dirty and clean pages create different eviction work.
- Cache pressure is a workload state, not just a memory percentage.
- The operating-system cache still participates in file I/O.
03
Reconciliation creates durable page images
When a dirty in-memory page is evicted or checkpointed, reconciliation writes a new on-disk representation. Updates can be split across pages and compressed before becoming blocks in the data file.
- Reconciliation is not the same event as transaction commit.
- Compression trades CPU for cache and storage efficiency.
- Repeated rewrites contribute to write amplification.
04
Timestamps define visible history
MongoDB supplies transaction timestamps while WiredTiger maintains update chains. Readers select a version appropriate to their read timestamp, and obsolete history can be removed only after it is no longer required.
- The oldest timestamp bounds removable history.
- Long-running snapshots retain versions and increase pressure.
- Timestamp order and wall-clock time are different coordinates.
05
The history store extends MVCC
Older committed values that no longer fit efficiently on the data page move to WiredTigerHS.wt. The history store lets readers reconstruct an older snapshot without keeping every version on the current page.
- History-store growth is usually a symptom of retained snapshots or update churn.
- It is shared engine infrastructure, not a user collection.
- Reading old versions can add history-store work.
06
Journal and checkpoints divide recovery work
The journal makes committed changes recoverable between checkpoints, while checkpoints establish a consistent durable view of all data files. Startup recovery replays journal records newer than the checkpoint.
- A checkpoint is not a global pause for every operation.
- Disabling durability changes the acknowledged-write contract.
- Disk failure resilience depends on filesystem and storage guarantees too.
07
Field manual
Concrete mechanics, diagnostic evidence, and executable patterns to carry into a real system.
01
Map namespaces to WiredTiger files
MongoDB exposes collection and index idents in catalog metadata. Join those idents to WiredTiger table URIs before attributing file size or I/O to a namespace.
db.getSiblingDB('inventory').runCommand({ listCollections: 1 })
// Then inspect index names with db.collection.getIndexes();
// Correlate catalog idents with collection-*.wt and index-*.wt files.
02
Read cache pressure as a flow
The useful WiredTiger cache signals distinguish bytes currently resident, dirty bytes, pages read and written, eviction work, and application threads forced to help eviction.
db.serverStatus().wiredTiger.cache
// Compare: bytes currently in the cache, tracked dirty bytes,
// pages read into cache, pages written from cache, and eviction counters.
03
Inspect transaction timestamp pressure
A pinned oldest timestamp prevents obsolete versions from being discarded and can grow the history store. Correlate transaction age, checkpoint progress, and history-store activity.
db.serverStatus().wiredTiger.transaction
db.currentOp({ active: true, secs_running: { $gte: 10 } })
// Investigate long snapshots before treating WiredTigerHS.wt growth as corruption.
04
Test the durability contract
Use acknowledged write concern and a controlled crash test to verify which writes survive process and host failure. Filesystem copy tests while mongod is running do not replace supported backup or snapshot coordination.
db.events.insertOne(
{ requestId: UUID(), createdAt: new Date() },
{ writeConcern: { w: 'majority', j: true } }
)
08
Source articles
Optional deep dives with the complete experiments and product-version context behind this guide.