15.10 - BSON Storage Format - Teradata Database

Teradata Database Teradata JSON

Teradata Database
Release Number
December 2015
English (United States)
Last Update

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.