|
Type |
Standard file format |
Binary file format |
|---|---|---|
|
Speed |
Comparatively less fast |
Faster |
|
Space |
Consumes comparatively less space. |
More space is consumed. |
|
Usage |
Transmission of data. |
Storage of data. |
|
Encoding and Decoding technique |
No such technique. |
Faster encoding and decoding technique. |
|
Characteristics |
Key value pair only used for transmission of data. |
Lightweight, fast and traversable. |
|
Structure |
Language independent format used for asynchronous server browser communication. |
Binary JSON which consist of a list of ordered elements containing a field name, type, and a value. Field name types are typically a string. |
|
Traversal |
JSON doesn’t skip rather skims through all the content. |
BSON on the other hand just indexes on the relevant content and skips all the content which does not have to be in use. |
|
Parse |
JSON formats need not be parsed as they are in a human readable format already. |
BSON, on the other hand, needs to be parsed as they are easy for machines to parse and generate. |
|
Creation type |
Broadly JSON consists of object and array where the object is a collection of key-value pairs and the array is ordered list of values. |
The binary encoding technique consists of additional information such as lengths of strings and the object subtypes. Moreover, BinData and Date data types are the data types which are not supported in JSON. |