BSON and UBJSON typically provide better traverse time compared to text-based JSON. Data stored in either of these formats can be searched using extraction techniques, and you may see an improvement in retrieval time when these formats are used.
The following provides a comparison between the different storage formats as a guideline for selecting the best storage format for your data.
JSON Text Format
- Requires the least amount of time for insertion
- Slower retrieval time
- Potentially requires more space
BSON Format
- Validation is done implicitly when converting from text
- Requires the most time to insert
- Faster retrieval time (tied with UBJSON)
- Works well when exchanging data with MongoDB
- Potential space savings when compared to text format
UBJSON Format
- Validation is done implicitly when converting from text
- Requires more time to insert than the text format, but less than BSON
- Faster retrieval time (tied with BSON)
- Typically provides space savings, especially when the includes a large number of numeric value