Image by diankarl via FlickrToday, Google announces the open-sourcing of their Protocol Buffers project. From a first glance, it seems to be a high-performance way to exchange deep data structures between different services (it seems Google has a need for that — they claim that their production servers constantly run at full capacity). XML parsing is not performant enough, raw byte streams are bound to break when one of the producers or consumers changes its internal format. Interface description languages have a bad reputation for being overly complex.
Enter Protocol Buffers. The official announcement is on Google’s opensource blog, and the code is released under the Apache License 2.0.
“Protocol Buffers allow you to define simple data structures in a special definition language, then compile them to produce classes to represent those structures in the language of your choice. These classes come complete with heavily-optimized code to parse and serialize your message in an extremely compact format. Best of all, the classes are easy to use: each field has simple “get” and “set” methods, and once you’re ready, serializing the whole thing to – or parsing it from – a byte array or an I/O stream just takes a single method call.”
Sounds interesting, and it could come in really useful in some of our upcoming projects. I’ll give it a try when I get the chance.














