On BNET: 5 classic computer pranks
BNET Business Network:
BNET
TechRepublic
ZDNet

July 9th, 2008

Google shares more of its secret sauce: Protocol buffers

Posted by Ed Burnette @ 7:48 am

Categories: General, Google, Programming

Tags: Google Inc., RPC, XML, Programming Languages, Storage, Networking, Software/Web Development, Web Development, Software Development, Hardware

It’s a common problem in computer science: how do you get data from one part of your program to another part? What if the two parts were written by different people, at different times, in different languages, on different machines? Search giant Google has to deal with this issue all time time, only at a bigger scale than most of us. This week they shared the solution they use , a home-grown technique called Protocol Buffers.

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.

You can think of protocol buffers as kind of a cross between XML and IDL (Interface Definition Languages). Compared to XML, they have several advantages for serializing structured data. From the documentation:

 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

Protocol buffers were written by Kenton Varda, based on an original design by Sanjay Ghemawat, Jeff Dean, and others. The package is used widely inside Google:

Protocol buffers are now Google’s lingua franca for data – at time of writing, there are 48,162 different message types defined in the Google code tree across 12,183 .proto files. They’re used both in RPC systems and for persistent storage of data in a variety of storage systems.

Version 2.0.0 Beta is available for download now. It supports C++, Java, and Python, but you can easily add support for other languages. All the source code is provided under the Apache license, and there are no restrictions on using this in free or commercial software.

Ed BurnetteEd Burnette is a professional developer and author of several articles and books about computing including Hello, Android: Introducing Google's Mobile Development Platform, 2nd Edition. For disclosure of Ed's industry affiliations, click here or to view his full profile click here.

Email Ed Burnette

Subscribe to Dev Connection via Email alerts or RSS.

  • Talkback
  • Most Recent of 4 Talkback(s)
RE: Google shares more of its secret sauce: Protocol buffers
What's the comparison with, say, JSON? (Read the rest)
Posted by: baz12345@... Posted on: 07/10/08 You are currently: a Guest | | Terms of Use
Finally, binary files are back happy  pauliusp | 07/09/08
CORBA!!!  betelgeuse68 | 07/09/08
As happened with the OSI stack vs TCP/IP, you can try to do TOO much.  DonnieBoy | 07/09/08
RE: Google shares more of its secret sauce: Protocol buffers  baz12345@... | 07/10/08

What do you think?

SponsoredWhite Papers, Webcasts, and Downloads

advertisement

Recent Entries

Archives

Favorite Links

ZDNet Blogs

White Papers, Webcasts, and Downloads

SmartPlanet

  • Thought-provoking progressive ideas on diverse topics that intersect with technology, business, and life, and matter to the world at large. Visit SmartPlanet
  • More from IBM
  • Innovate your business' process model, play against the market, compete against others on our scoreboards and WIN! Try INNOV8 2.0: A BPM Simulator
  • Enabling Real-World Business Transformation through IBM Service Management Read the EMA Analyst Report
Click Here