knowledge/technology/files/BSON.md
2024-01-17 09:00:45 +01:00

14 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
obj: concept
website: https://bsonspec.org
wiki: https://en.wikipedia.org/wiki/BSON
---
# BSON
BSON, short for Bin­ary [JSON](JSON.md), is a bin­ary-en­coded seri­al­iz­a­tion of [JSON](JSON.md)-like doc­u­ments. Like [JSON](JSON.md), BSON sup­ports the em­bed­ding of doc­u­ments and ar­rays with­in oth­er doc­u­ments and ar­rays. BSON also con­tains ex­ten­sions that al­low rep­res­ent­a­tion of data types that are not part of the [JSON](JSON.md) spec. For ex­ample, BSON has a Date type and a BinData type. [MongoDB](../applications/development/MongoDB.md) uses BSON internally for storing the database.
BSON was de­signed to have the fol­low­ing three char­ac­ter­ist­ics:
- Lightweight: Keep­ing spa­tial over­head to a min­im­um is im­port­ant for any data rep­res­ent­a­tion format, es­pe­cially when used over the net­work.
- Traversable: BSON is de­signed to be tra­versed eas­ily. This is a vi­tal prop­erty in its role as the primary data rep­res­ent­a­tion for Mon­goDB.
- Efficient: En­cod­ing data to BSON and de­cod­ing from BSON can be per­formed very quickly in most lan­guages due to the use of C data types.