What is Protocol Buffers
Protocol Buffers (protobuf) is a binary serialization format created by Google. You define data structures in a .proto file, and the protoc compiler generates code to serialize and deserialize them in any supported language.
How it works
Each field in a protobuf message has a numeric tag and a type. The binary format encodes the tag and value directly — no field names, no delimiters, no quotes. A message like {"id": 42, "name": "Alice"} that takes 27 bytes in JSON takes about 9 bytes in protobuf. Integers use variable-length encoding (varint), so small numbers take fewer bytes.
Schema evolution works through field tags. New fields get new tags. Old clients ignore unknown tags. Deleted fields have their tags reserved to prevent reuse. This makes protobuf backward and forward compatible without versioning.
Why it matters
Protobuf's compact binary format reduces network bandwidth and serialization time compared to JSON. For high-throughput internal services, the difference is significant — especially when millions of messages flow between services per second. The tradeoff: protobuf messages are not human-readable. You can't inspect them with curl or read them in browser dev tools without tooling.
See How gRPC Works for how Protocol Buffers integrate with HTTP/2 transport.