BSON — screenshot of bsonspec.org

BSON

BSON is the Binary JSON specification, a compact serialization format famously used by MongoDB. Its minimal spec surface makes it quite neat and approachable for self-implementation.

Visit bsonspec.org →

Questions & Answers

What is BSON?
BSON, short for Binary JSON, is a binary-encoded serialization format for JSON-like documents. It supports embedded documents and arrays and includes extensions for data types not present in standard JSON, such as Date and BinData.
Who primarily uses BSON?
BSON is notably used as the primary data representation format by MongoDB. It is designed for systems requiring a lightweight, traversable, and efficient binary serialization method.
How does BSON compare to other binary interchange formats like Protocol Buffers?
BSON is considered more "schema-less" than Protocol Buffers, offering greater flexibility. However, this flexibility can result in slightly less space efficiency due to overhead for field names within the serialized data.
When is BSON a suitable choice for data serialization?
BSON is suitable when you need a binary serialization format that balances flexibility with efficiency and traversability, particularly in environments like MongoDB where it serves as the core data representation. It's also good for systems where easy traversal of documents is vital.
What are the key characteristics BSON was designed to have?
BSON was designed to be Lightweight, meaning it minimizes spatial overhead; Traversable, allowing easy navigation through its structure; and Efficient, enabling fast encoding and decoding due to its use of C data types.