What do you think of protobuf?

protobuf is so interesting, can mongodb use protobuf?

Hi @anlex_N,

There’s a brief mention on the BSON spec homepage:

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).

The protobuf (Protocol Buffers) serialisation format uses a .proto description of the data structure you want to work with. BSON uses schema-on-read: field names and data types are embedded in the BSON document.

The schema-on-read aspect provides an advantage in distributed data systems: there is no central schema catalog to maintain or refer to, and a document contains all the information needed for deserialisation.

You could use protobuf (or other serialisation formants) in your client applications, but data ultimately has to be serialised to/from BSON for the current MongoDB Wire Protocol.

Regards,
Stennie

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.