v1.10

Document

How to Start SequoiaDB

Basic Operation

Data Model

Database Management

Aggregation

Index

Replication

Cluster

Connector

Reference

Development

Release Note

FAQ

  • Content
  • Comments
  • History

Binary Data

Concept

In SequoiaDB, data is read in the format of JSON object. So users should encode bindata with Base64, and send it to database in the format of string.

Format

The format of bindat is as follow:

{ "$binary" : "<data>", "$type" : <type> }

In this format, "data" should be encoded with Base64. "Type" is a decimal value between 0 and 255. Users can choose type values in this range to identify types in applications.

Base64 is an universal format of transforming data, which is mainly transforming bindata into byte stream in the format of ASCII string. Generally, data becomes longer after transformation.

In order to save storage space, in SequioaDB, Base64 data is transformed into original data before being stored in database. When users request to read data, it is transformed and provided in the format of Base64 again.

Sample

For example, string "hello world" is encoded with Base64 into "aGVsbG8gd29ybGQ=". JSON data containing "hello world" bindata, with type of "1" is:

{ "key" : { "$binary" : "aGVsbG8gd29ybGQ=", "$type" : 1 } }
please login to comment.
Latest Comment
  • 2015-02-14

About Us

SequoiaDB is a financial-level distributed database vendor and is the first Chinese database listed in Gartner’s Magic Quadrant OPDBMS report. SequoiaDB has recently released version 3.0.
SequoiaDB is now penetrating the vertical sector Financial Industry quickly and had more than 50 banking clients and hundreds of enterprise customers in industries including government, telecommunication, Internet and IoT.

Beijing:
Tower R, No.8 North Star East Road, Chaoyang District, Beijing,China
Guangzhou:
Tower A, No.22 Qinglan Street, Panyu District, Guangzhou,China
Shenzhen:
Tsing Hua Tech Park, Nanshan District, Shenzhen,China
Tel:400-8038-339
E-mail:contact@sequoiadb.com