Additionally, BSON files are easily stored and sent through the network, making them perfect for storing and sending data. Lightweight and TraversableīSON is lightweight: This makes it possible for a large amount of data to be stored in BSON file format. The following three characteristics make BSON advantageous to use. To know more about the differences between BSON and JSON, visit JSON and BSON. Used to send data through the network (mostly through APIs). Unlike JSON, BSON offers additional data types such as bindata for binary data, decimal128 for numeric. JSON has a specific set of data types-string, boolean, number for numeric data types, array, object, and null. JSON is a human-readable format that doesn't require parsing.īSON needs to be parsed as they are machine-generated and not human-readable. We can send JSON through APIs without encoding and decoding.īSON files are encoded before storing and decoded before displaying. JSON data is slightly smaller in byte size.īSON data is slightly larger in byte size. JSON is fast to read but slower to build.īSON is slow to read but faster to build and scan. To learn more about BSON specifications, visit BSON documentation. Storage is based on data (A byte array uses 1 byte, a short array uses 2 bytes, and an integer array uses 4 bytes) byteĤ bytes (32-bit signed integer, two's complement)Ĩ bytes (64-bit signed integer, two's complement)Ĩ bytes (64-bit IEEE 754-2008 binary floating-point)ġ6 bytes (128-bit IEEE 754-2008 decimal floating-point)ġ2 bytes(4-byte timestamp value, 5-byte random value, and 3-byte incrementing counter) The following are some of the types included in BSON. The topmost element in the structure must be of type BSON object and should contain one or more elements, where an element can be a field name (string), a type, or a value. BSON Specifications and BSON TypesīSON specification version 1.1 is published at. The greater difference is that BSON is more "Schema-less" than Protocol Buffers, providing the advantage of flexibility and the slight disadvantage of space efficiency. BSON has been extended to add some optional non-JSON-native data types, like dates and binary data.īSON can be compared to other binary formats, like Protocol Buffers. It is a binary-encoded serialization of JSON documents. What Does BSON Stand For?īSON stands for Binary Javascript Object Notation. Just like JSON, BSON supports various programming languages such as C, C , C#, Java, JavaScript, PHP, Python, Ruby, and Swift. \x00 // 0x00 = type EOO ('end of object') BSON encodes type and length information, too, making it easier for machines to parse. JSON is easier to understand as it is human-readable, but compared to BSON, it supports fewer data types. BSON is a binary encoded Javascript Object Notation (JSON)-a textual object notation widely used to transmit and store data across web based applications.
0 Comments
Leave a Reply. |