🍋
Menu
.bson Data

BSON (Binary JSON)

BSON ist ein binäres JSON-Format, das von MongoDB verwendet wird. Es erweitert JSON um zusätzliche Datentypen (Datum, Binärdaten, ObjectId) und ermöglicht effizientes Traversieren von Dokumenten.

MIME-Typ

application/bson

Typ

Binaer

Komprimierung

Verlustfrei

Vorteile

  • + Rich type system beyond JSON (dates, ObjectId, binary, Decimal128)
  • + Efficient for database storage — length-prefixed for fast scanning
  • + Supports in-place updates without rewriting entire documents

Nachteile

  • Can be larger than JSON for string-heavy documents
  • Not human-readable — requires tooling to inspect
  • Primarily MongoDB-specific — limited use outside that ecosystem

Wann Sie .BSON verwenden sollten

BSON wird hauptsächlich intern von MongoDB verwendet. Für allgemeine binäre Serialisierung verwenden Sie MessagePack oder Protobuf.

Technische Details

BSON kodiert JSON-Dokumente in einem binären Format mit Längen-Präfixen für effizientes Traversieren. Es unterstützt zusätzliche Typen: Date, BinData, ObjectId, Decimal128, Regex und JavaScript.

Geschichte

MongoDB Inc. entwickelte BSON als internes Speicher- und Netzwerkformat für die MongoDB-Datenbank.

Von .BSON konvertieren

In .BSON konvertieren

Verwandte Formate