Saturday, March 21, 2009

Protobuf - Data Interchange Format

It is a language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage etc

Protocol Buffers are a way of encoding structured data in an efficient yet extensible format.Google uses Protocol Buffers for almost all of its internal RPC protocols and file formats.

You define how you want your data to be structured once, then you can use special generated
source code to easily write and read your structured data to and from a variety of data streams
and using a variety of languages

You specify how you want the information you're serializing to be structured by defining protocol
buffer message types in .proto files. Each protocol buffer message is a small logical record of
information, containing a series of name-value pairs.Once you've defined your messages, you run
the protocol buffer compiler for your application's language on your .proto file to generate data
access classes.

These data access classes can be in any of the languages such as C , Java ,Python etc.These provide simple accessors for each field as well as methods to serialize/parse the whole
structure to/from raw bytes. These generted classes can be shipped along with any client where
serialisation or deserialsation is required.

You can even update your data structure without breaking deployed programs that are compiled
against the "old" format.

Protocol buffers have many advantages over XML for serializing structured data.

Protocol buffers:
* are simpler
* are 3 to 10 times smaller
* are 20 to 100 times faster
* are less ambiguous
* generate data access classes that are easier to use programmatically

Ref : http://code.google.com/p/protobuf/

No comments:

 
Free Domain Names @ .co.nr!