16.20 - BSON Storage Format - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ JSON Data Type

Teradata Database
Teradata Vantage NewSQL Engine
March 2019
Programming Reference

BSON is a binary storage format for JSON data. The BSON specification is located at http://bsonspec.org/. BSON maintains the overall structure of JSON text data, but it encodes data type, variable length, and nesting information. It is designed to be lightweight so there is little additional overhead as compared to text-based JSON in terms of storage. It is easily traversable and efficient in terms of the time needed to convert to and from BSON.

The standard data types for JSON are as follows:
  • Object
  • Array
  • String
  • Number
  • null
  • Boolean
BSON provides some additional data types, including the following:
  • Binary data
  • Floating point
  • Date
  • Timestamp
You should use the BSON storage format in the following cases:
  • When exchanging data with MongoDB
  • When retrieval of portions of the document is more important than insertion time
  • When compactness of storage is not as important as retrieval speed

BSON encodes strings in the UTF-8 character set. The character set for BSON data when it is imported or exported as text is UNICODE.

Numeric types are always serialized in little-endian format. If data is imported to or exported from the database in the BSON format (via constructor/instance methods or cast expressions), it is expected to be in this format.