EN
Back to the archive

The encyclopedia · Engineering & Operations · Technical decision · 2001–2008

Google's Protobuf made service data a schema, and the wire format won

Google open-sourced Protocol Buffers in 2008: schema-defined messages compiled to any language, serialized compactly — the service-to-service standard.

Google

The solution

Google's internal services needed to exchange structured data at scale, and the existing options were too slow, too bulky or too ad hoc. So the company developed Protocol Buffers: a definition language for describing data structures, plus a compiler that generates classes for those structures in the developer's language of choice.

The generated classes carry heavily optimized serialization code: each field has simple get and set methods, and turning the whole message into a byte array or I/O stream — or parsing it back — takes a single method call. The wire format is extremely compact, which matters when every byte crosses a data center.

In July 2008 Google made Protocol Buffers open source, explicitly so more people could take advantage of and build on the work. The project's documentation describes it as a language-neutral, platform-neutral, extensible mechanism for serializing structured data, with generated-code support spanning a dozen-plus languages.

Why it worked

  • The compiler produces correct, optimized parse/serialize code in any language.
  • Compact binary output cut bandwidth and storage versus text formats.
  • A single schema keeps services honest about their wire contract.
  • Open-sourcing removed the vendor-lock fear from adopting it.
What it achievedSchema first; code generation for every languageclever

What can be applied

Define the contract once in a schema and generate code everywhere; the format wins because compactness and cross-language support are baked into the toolchain.

Aftermath

Protocol Buffers became the standard way Google services talk, and its schema-first pattern spread through the open-source tooling built on it — the documentation still markets it as the language-neutral, platform-neutral mechanism for serializing structured data, with APIs from C++ to Rust.

Sources

spotted an error? The archive wants to know.

Related cases