본문 바로가기

Software&Platform

BSON

가.개요

BSON은 컴퓨터 데이터를 상호 교환하기 위한 양식이다. 이것은 간단한 구조화 결합된 배열을 나타내는 Binary 폼이다. BSON은 Binary JSON의 약어이다.

 

나.Data Type and Syntax

BSON 문서(혹은 객체)는 element들의 리스트로 구성되어 있다. 각각의 Element는 field name, type, value로 구성되어 있다. field name은 문자열이다.

type은 string, integer, double, date, byte array(binary), boolean(true/false), null, BSON object, BSON array 을 포함한다.

 

이는 JSON을 포함한다. (예를 들면, JSON은 byte array가 없다.). 그러나 길이 제한때문에 몇몇 valid JSON의 값(very long string)이 BSON에서는 not valid 한 값이기도 하다.

 

 

출처 : Wikipedia.org

 

 

BSON [bee · sahn], short for Bin­ary JSON, is a bin­ary-en­coded seri­al­iz­a­tion of JSON-like doc­u­ments. Like JSON, BSON sup­ports the em­bed­ding of doc­u­ments and ar­rays with­in oth­er doc­u­ments and ar­rays. BSON also con­tains ex­ten­sions that al­low rep­res­ent­a­tion of data types that are not part of the JSON spec. For ex­ample, BSON has a Date type and a BinData type.

 

BSON can be com­pared to bin­ary inter­change for­mats, like Proto­col Buf­fers. BSON is more "schema-less" than Proto­col Buf­fers, which can give it an ad­vant­age in flex­ib­il­ity but also a slight dis­ad­vant­age in space ef­fi­ciency (BSON has over­head for field names with­in the seri­al­ized data).

BSON was de­signed to have the fol­low­ing three char­ac­ter­ist­ics:

  • Lightweight

    • Keep­ing spa­tial over­head to a min­im­um is im­port­ant for any data rep­res­ent­a­tion format, es­pe­cially when used over the net­work.

  • Traversable

    • BSON is de­signed to be tra­versed eas­ily. This is a vi­tal prop­erty in its role as the primary data rep­res­ent­a­tion for Mon­goDB.

  • Efficient

    • En­cod­ing data to BSON and de­cod­ing from BSON can be per­formed very quickly in most lan­guages due to the use of C data types.

 

출처 : http:bsonspec.org

 

 

 

 

 

이 글은 스프링노트에서 작성되었습니다.

'Software&Platform' 카테고리의 다른 글

Thrift  (0) 2011.12.16
RPC  (0) 2011.12.15
MapReduce  (0) 2011.12.15
JSON  (0) 2011.05.30
REST (Representational State Transfer)  (0) 2011.05.17