OfferTransform Your Career with Expert-Led IT Training. Flat discounts active!Explore Now
OnlineITGuru Logo
LIMITED PERIOD OFFER - FLAT 20% OFF
Cloud Computing & DevOps

MongoDB WiredTiger Engine: Architecture & Performance

Last updated on Dec 2, 2026

Copy Link:
MongoDB WiredTiger Engine: Architecture & Performance

Beneath every database management system there is a core layer that is responsible for mapping logical data structures to persistent bytes on physical storage media. In MongoDB, the storage engine is that layer. It determines how collections and indexes are stored in memory, how records are written to and read from disc, how concurrent readers and writers coordinate their activities so they don't trample on each other, and how the database recovers cleanly from unexpected power losses or process crashes. WiredTiger has been the platform’s default storage engine since MongoDB 3.2, powering self-managed deployments and cloud clusters on MongoDB Atlas.

It’s helpful to look back at what preceded it to understand why WiredTiger is so important. The MMAPv1 storage engine was widely used in the early versions of MongoDB. MMAPv1 mapped data files directly into virtual memory, letting the operating system handle much of the memory scheduling. That approach was fine and fast when you had a single node, or a read-heavy setup, but as applications scaled it started to hit serious friction. Coarse-grained locking could block write-heavy workloads, updating documents in place with new fields or larger arrays frequently caused fragmentation and document relocation, and there was no native on-disk compression. To overcome those structural limitations, MongoDB acquired WiredTiger, Inc., in late 2014. WiredTiger was designed by engineers with deep embedded database backgrounds, for modern multi-core CPUs, large memory pools and solid state drives. It combines B-tree structures, non-overwriting storage, multi-version concurrency control and pluggable compression.

In case you are looking for the development and becoming the expert on these basics by mongodb learn online at OnlineITGuru, then you can have a good foundation of the NoSQL structure.

WiredTiger combines in-memory caching, B-tree page structures, journaling and persistent storage files to implement fast and crash-safe concurrent database operations, as shown in the diagram above.

WiredTiger Core Architectural Foundations

WiredTiger doesn’t rely on a single trick for its throughput and reliability, but a tightly integrated set of architectural mechanisms. Each subsystem addresses a specific storage, concurrency or recovery bottleneck and reinforces others.

Dual-Tier Memory Architecture: Internal Cache & File System Cache

WiredTiger memory management is at two complementary levels, WiredTiger internal cache, and the operating system filesystem cache. By default, WiredTiger sets its internal cache to the larger of 50 percent of total system RAM minus one gigabyte, or 256 megabytes. Any free memory on the machine that is not used by the WiredTiger cache, the operating system itself, or other running processes is available to the filesystem cache.

Critically, data is not stored in exactly the same representation in both tiers. Data pages are stored in the same compressed format as on disc in the operating system filesystem cache. If compressed blocks remain in the filesystem cache, then the host can keep a much larger working set in memory than the raw uncompressed size would permit. This reduces physical disc reads as pages are brought into the database.

Collection data is decompressed into an in-memory representation optimised for fast traversal and modification within WiredTiger’s own internal cache. Query execution and updating documents work against uncompressed data in the WiredTiger cache. If you are inspecting and modifying a field in-memory, the engine does not have to decompress and re-compress a document each time. Index pages in the internal cache have a slightly different path. The in-memory layout is different from the on-disk format, but they also use prefix compression to keep memory consumption compact. Also note that WiredTiger's cache is global to the entire database server instance, not divided into fixed quotas per collection, or pinned to specific documents.

Structures of pages in memory and B-tree organization

WiredTiger stores collections and indexes in separate files on disc, each file primarily organised as a B-tree. A B-tree sorts keys, and consequently searches, range scans, insertions and deletions run in predictable logarithmic steps. WiredTiger allows internal and leaf nodes of a B-tree to have different sizing characteristics. The internal pages remain small to help efficiently guide tree traversal with minimum CPU cache misses while the leaf pages can accommodate larger payloads to amortise disc I/O over more records.

When WiredTiger reads a leaf page from disc into its internal cache, it constructs lightweight in-memory structures (e.g., skip lists and update chains) around the contents of the page. Updates and new entries cleanly attach to in-memory update chains, not mutate existing base bytes in place inside the cache. Lock-free and fine-grained synchronisation techniques allow multiple threads to read or modify different records associated with a page without serialising all access behind a heavyweight page-wide lock. Over time background eviction threads reconcile dirty pages, write updated blocks out to disc and free cache space so new working-set data can enter.

Document-Level Isolation and Multiversion Concurrency Control

The primary architectural change in WiredTiger is the use of Multi-Version Concurrency Control (MVCC) and optimistic concurrency approaches, replacing coarse locking. WiredTiger does not overwrite a record in place and make readers wait for writers or writers wait for readers. Instead, it keeps multiple versions of data with transaction timestamps or identifiers.

A read operation always sees a consistent, point-in-time view of the database. It reads B-tree pages and version chains and picks the version valid at the time in the snapshot, without blocking active writers. In contrast, writers don’t stop readers. Regarding concurrency, WiredTiger provides document level concurrency, which means that two threads updating different documents in the same collection can update them concurrently without locking the entire collection. If two concurrent transactions collide on exactly the same document, WiredTiger detects the write conflict and cleanly retries, preserving consistency but avoiding a centralised lock bottleneck. Modern MongoDB releases also dynamically tune the storage engine read and write concurrency tickets under heavy load to maintain throughput fluidity as contention increases.

Checkpoints, Snapshots and Write-Ahead Logging

WiredTiger durability is based on two coordinated mechanisms, periodic checkpoints and a write-ahead journal. WiredTiger is a non-overwrite engine for data blocks, meaning that it writes modified pages to new locations on disc instead of overwriting previous valid blocks in place.

A checkpoint is a consistent snapshot of committed data across the engine at a given point in time . It flushes modified pages to disc . Until all pages in a checkpoint are safely written and verified , the engine holds the previous valid checkpoint . If power is lost or a process is interrupted in the middle of a checkpoint, the database can recover from the last checkpoint that was completed.

WiredTiger employs a journal (a write-ahead log) to bridge the interval between checkpoints without losing recent writes. The journal is written sequentially in changes . If the server crashes unexpectedly between checkpoints , then on startup recovery , journal entries are replayed from the last checkpoint forward to restore committed modifications . WiredTiger supports end-to-end checksums and data verification tools to detect hardware or storage corruption early.

Native Compression: Block, Prefix and Journal Compression

Storage bandwidth and disc space are often the costliest cost drivers in large databases. WiredTiger has integrated compression into its storage pipeline so that engineers can exchange some CPU consumption for significantly reduced storage requirements and I/O.

WiredTiger compresses collection data files at the block level prior to writing blocks to disc. Most collections default to using Snappy, which offers fast compression and decompression with a low overhead on the CPU. MongoDB defaults to Zstandard (zstd) for workloads with strong repetitive patterns, like time-series collections, where it offers better compression ratios. Or they can choose zlib or turn off compression if the CPU is tight or the data is already compressed.

WiredTiger uses prefix compression on the indexes. B-tree indexes store keys in sorted order so keys that are nearby often share common leading bytes (e.g. identical prefixes in strings, dates, or compound key fields). Prefix compression stores the common leading bytes once per block instead of repeating them on every entry, thus reducing the size of both on-disk index files and in-memory index footprints. WiredTiger compresses journal records by default to reduce journal write volume (using Snappy unless configured otherwise, skipping tiny records at or below 128 bytes).

Key Performance Benefits for Real World Workloads

Together, these architectural pillars provide MongoDB with distinct operational and performance benefits for modern applications.

Higher Concurrency and Multi-Core Scaling

Modern applications do not run on a single CPU core and serve a single user at a time. APIs, microservices, background workers, analytics queries — they all hit the database at once. WiredTiger combines document-level concurrency with MVCC, and lock-free or fine-grained internal structures, so that many threads can read and write concurrently without passing through a single global or collection-level lock. Multi-core servers can increase overall throughput and reduce lock-induced tail latency by keeping cores busy with mixed read-write traffic.

Smaller storage footprint and reduced disc I/O

Compression is not only a disk-saving feature, but also a performance multiplier. Using compression for collection blocks and index pages on disc means less data must travel over storage buses or network attached block devices for reads and writes. In cloud environments where storage capacity and IOPS are charged separately or are tied to volume size, smaller data files directly reduce infrastructure spend while speeding up backups, restores and initial syncs.

At the same time the operating system filesystem cache stores data in its on-disk compressed form, so more compressed pages can fit in available RAM. If the page the database is looking for is warm in the filesystem cache then a slow physical disc read is avoided. This is a huge win for latency sensitive applications where the active dataset is larger than the internal cache.

Improved Efficiency of Flash & SSD

Most modern production databases run on solid-state drives. Flash storage is great for parallel reads and sequential writes, but small, fragmented random overwrites can lead to write amplification and increased wear on flash cells over time. WiredTiger's architecture is naturally well-suited for sequential journal appends, batched checkpoint flushes, and non-overwriting block allocation. WiredTiger groups changes together and writes blocks cleanly, rather than constantly rewriting small spots in place. This fits nicely with the way SSD controllers and filesystems work.

Less Fragmentation and Maintenance Interruptions

Storage engines that employ in-place updates and fixed-slot allocation suffer from internal gaps due to frequent document growth, updates and deletes, which impact space efficiency and require offline compaction from time to time. WiredTiger uses a non-overwriting page model and block allocation that continuously reclaims the freed space as pages are written and evicted. All storage engines are susceptible to workload skew, but continuous space reuse helps keep fragmentation under control and reduces the need for disruptive maintenance windows.

Multi-Document ACID Transactions Support

Many business workflows, such as transferring balances, updating inventories along with order records, or coordinating state across multiple collections, need all-or-nothing atomicity and isolation. WiredTiger’s MVCC snapshot model also provides the point-in-time isolation guarantees behind MongoDB’s multi-document ACID transactions across replica sets and sharded clusters. Applications can provide strong consistency guarantees when needed without giving up MongoDB’s flexible document model.

Getting the Most out of WiredTiger: Practical Operational Principles

Learning about the above-tuned parameters constitutes the basic knowledge of mongodb dba online training programs which will help administrators in avoiding situations such as memory starvation and eviction in the future.

First, size the host memory considering both cache tiers. WiredTiger defaults to taking a large chunk of RAM for its internal cache and relies on the operating system filesystem cache for the rest. When memory-hungry applications or multiple database processes are colocated on the same server, without tuning the cache limits, it can trigger memory pressure or out-of-memory terminations. In contrast, setting the WiredTiger internal cache too high can starve the filesystem cache and the operating system.

Second, watch out for long-lived read operations or long open transactions during heavy write bursts. The old versions of the documents are retained by MVCC for the snapshots currently in use. Old versions of documents held by transactions or cursors that survive for an extended period of time could also be held by the memory and the history of the snapshot beyond your expectation. The accumulation of the dirty pages more quickly than the background process could lead to their eviction by the foreground thread.

Third, tailor compression choices to your workload profile. Snappy is a good default for general purposes when you need a balance of speed and space savings, whereas Zstandard excels when maximising compression on repetitive data is more important than spending extra CPU cycles. Always test changes under real world load to make sure that the reduction in disc I/O is more than offset by any increase in CPU utilisation.

Conclusion

WiredTiger made MongoDB a high concurrency, space efficient database engine, perfect for demanding modern workloads. It uses a dual-tier caching strategy, hardware-aware B-trees, multi-version concurrency control (MVCC) with document-level concurrency, crash-resilient checkpoints and journaling, and flexible compression to achieve strong multi-core throughput, smaller storage footprints, and reliable durability. Understanding how the pieces fit together helps engineers design schemas, size hardware and tune workloads with confidence as data volumes and concurrency continue to grow.

At the memory layer WiredTiger balances two complementary caches: its own internal cache and the operating system filesystem cache. The internal cache is for working data in fast in-memory form for active reads and updates . The filesystem cache is for compressed on-disk blocks so that more data can stay warm in RAM without an immediate disc read . All these tiers work together to minimise physical I/O and keep hot collections and indexes responsive under changing traffic patterns.

WiredTiger uses B-trees optimised for modern hardware to store collections and indexes on disc and in memory. Compact internal nodes provide a fast hint for tree traversal, and leaf pages store larger sets of records and use in-memory update chains, so that changes attach cleanly without heavy in-place rewrites. Background eviction threads constantly reconcile changes and reclaim space, which helps limit fragmentation and avoid disruptive offline compaction windows.

WiredTiger is also designed with concurrency and crash recovery in mind. Document-level concurrency and MVCC snapshots allow readers to not block writers and vice-versa, which allows multi-core servers to effectively process parallel workloads, and supports multi-document ACID transactions. Periodically, checkpoints are made to flush consistent snapshots to disc, and a sequential write-ahead journal records changes between checkpoints to allow for reliable recovery after unexpected restarts.

Compression not only improves storage economics it also improves I/O performance. Collection files are block compressed (Snappy by default or Zstandard for greater compression) on repetitive data such as time-series records, reducing disc usage and the number of bytes transferred during reads, writes, backups and the initial sync. Index size in memory and on disc is reduced by prefix compression of sorted index keys, allowing more index entries to be accommodated in available RAM.

These mechanisms help engineering teams in making capacity planning and performance tuning more predictable. Host memory is sized to support both the WiredTiger internal cache, and the filesystem cache, such that neither starves the other, nor the operating system. Prompt transaction and read cursor handling avoids version chains hanging around and applying pressure to eviction threads . Selecting compression algorithms balances CPU overhead with storage and I/O objectives . For practical experience of working with such clusters, refer to the mongodb online classes offered by OnlineITGuru.

Why Choose Us

Master Your Future with OnlineITGuru

We don't just provide courses; we build careers. From expert-led live training to dedicated placement support, discover why thousands of professionals trust us for their digital transformation journey.

200+

Partner Companies

$120K

Highest Package

75%

Average Hike

98%

Placement Rate

Reliable Career Partners

Google
Microsoft
Amazon
Meta
Netflix
Apple