December 10th, 2010

Sunny Santosh

Protocol Buffers

Every time I see teams working on a new project , they say oh well, lets design the interfaces first. And then they again go through the draconian ritual of defining xml schemas and agree on data formats and the protocol. And I just hate XML and SOAP and all that's chatty. Every time programmers are figuring out newer inefficient mechanisms to parse data. The amount of time that is spent on this again is ridiculous and unjustified.

Now look at Jabber's protocol or the XMPP protocol as they call it. Hugely popular as it may be  , but its still pretty inefficient considering many times the xml envelop in which the payload is sent is several times heavier than the actual data itself. 

Usually the data construction and parsing logic has no error handling which can cause a small invalid data to crash the entire system This is often due to weak logic both on the sending party and receiving party.

I am hoping protobuf will address these issues. You are only considering what to exchange , the how factor is always figured. And yes you save some code as well.