advanced~2.5h

MongoDB — BSON Encoding & the WiredTiger Storage Engine

Every earlier chapter treated a document as a JSON-like object you read and write. This chapter opens the box: the binary format MongoDB actually stores on the wire and on disk, and the storage engine underneath that decides how fast a write really commits, how much space a collection really takes, and how two writers to different documents in the same collection manage to not block each other.

Learning objectives

  • Explain why MongoDB encodes documents as BSON rather than storing plain-text JSON.
  • List the BSON types that have no JSON equivalent and why each one earns its place.
  • Describe how WiredTiger achieves document-level concurrency control instead of locking a whole collection.
  • Explain how WiredTiger's compression and B-tree storage layout affect both disk usage and read/write throughput.
  • Reason about when a write is durable versus merely applied in memory, using the WiredTiger cache and checkpoint model.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.

MongoDB — BSON Encoding & the WiredTiger Storage Engine

Next Step

Continue to MongoDB — Change Streams & Atlas Vector Search →← Back to all MongoDB chapters