Skip to main content

Why does MongoDB store data in the BSON format?

MongoDB uses BSON because this format is more convenient and faster for a database to work with than plain JSON.

Briefly, at a junior level

  1. Fast processing BSON is a binary format. It's easier for a computer to read binary data than text, so operations run faster.
  2. Extra data types JSON has no types like Date or ObjectId. BSON supports them, which is handy for a database.
  3. Compactness BSON takes up less disk space, so it loads into memory faster.
  4. Fast lookups BSON stores the length of documents and fields, so MongoDB can find the data it needs faster.

Summary: BSON makes MongoDB faster, more efficient, and more functional at working with documents than JSON would.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.