Skip to main content

Protocol Buffers

Protocol Buffers is a compact, schema-driven binary serialization format from Google, used widely with gRPC for efficient cross-language messaging.

Protocol Buffers, often shortened to protobuf, is a binary serialization format and interface definition language created by Google. It encodes structured data into a compact binary representation defined by an explicit schema.

How It Works

Developers describe message types in a .proto file, declaring fields with names, types, and numeric field tags. A compiler, protoc, generates serialization and parsing code for many languages from that schema. On the wire, only the field tags and values are encoded, not the field names, which makes payloads small and fast to parse.

The numeric field tags are central to compatibility. New optional fields can be added without breaking older readers, which ignore unknown tags, and old fields can be retired by reserving their numbers. This makes protobuf well suited to evolving schemas across many services.

Why It Matters

Compared with text formats like JSON, Protocol Buffers produces significantly smaller messages and serializes faster, which matters for high-volume internal communication. It is the default payload format for gRPC and a common choice for event streams and storage.

The cost is readability and accessibility. Binary payloads cannot be inspected without the schema and tooling, and browsers cannot consume protobuf directly. Teams therefore often keep JSON at public, browser-facing edges and use protobuf for service-to-service traffic where efficiency and a strong contract matter most.

Related Terms

Protocol Buffers is the message format for gRPC, runs over HTTP/2, and is commonly contrasted with JSON.