Protocol Buffers

Google has open-sourced its protocol buffers. What exactly is a protocol buffer? What are its advantages? Let’s discuss.

What is a Protocol Buffer

Protocol buffers are an automated mechanism to serialize structured data in an easy, effective and flexible way. This is great to do an update on an old data structure without affecting its functionality.

Protocol buffers also helps pull data from numerous resources using all popular languages. Well you might think, aren’t XML files doing the same? They help read write data, store then sequentially and they are flexible. When you consider storing, retrieving, updating millions of data at a flash of a second, then protocol buffers certainly have a lot of advantages over XML.

Protocol Buffers Vs XML

Protocol buffers are at least 20 to 100 times faster than XML. If you are handling enormous amount of data, protocol buffer is the best option
Protocol buffers are much simpler and hence better understood and easy to program.
Protocol buffers are at least 3 to 100 times smaller in size. While dealing with huge data, it definitely makes a difference.

Protocol buffers were developed by Google using an index server request/response protocol. There are 48,162 different message types defined in 12,183 .proto files in the Google code tree. These are used by Google RPC and in persistent storage of data.