MongoDB DBA Associate study materials
MongoDB DBA Associate study resources

MongoDB DBA Associate: Storage Engine, WiredTiger, and Data Modeling Considerations

MongoDB DBA Associate · Work through your exam, one topic at a time.

All guide sections

Storage Engine, WiredTiger, and Data Modeling Considerations

What this domain covers

Storage Engine, WiredTiger, and Data Modeling tests your knowledge of WiredTiger internals and how document shape affects performance.

Core rules

  • WiredTiger is the default storage engine. Its cache is 50% of (RAM minus 1 GB) or 256 MB, whichever is larger. The cache holds uncompressed data; compression reduces disk, not cache pressure.
  • The journal provides durability; checkpoints persist data every 60 seconds by default. WiredTiger uses snappy, zlib, or zstd compression at collection and index level.
  • Model for access patterns. Embed bounded one-to-few data; reference unbounded one-to-many data. Avoid arrays that grow without limit; the 16 MB document limit and write amplification will bite.
  • Compound indexes follow the ESR rule: equality fields first, sort fields next, range fields last. A compound index can support a prefix of its keys.

Worked example

A blog post document embeds all comments. Popular posts grow past 16 MB and every comment update rewrites a large document. Instead, store comments in a separate collection with an index on post_id and created_at. Fetch the post and the first page of comments with two targeted queries. If comments are bounded to a few dozen, embedding is fine; if unbounded, reference.

Traps

Setting cache size too high and starving the OS; thinking compression shrinks cache; using unbounded arrays; building indexes without considering sort order; and assuming _id is not indexed, when it always is.