Web apps & software

What are Protocol Buffers (protobuf)?

Protocol Buffers, usually called protobuf, is a binary format from Google for serializing structured data. You describe the fields in a .proto file, and tools generate code to read and write compact messages.

How it differs from JSON

JSON is text anyone can read; protobuf is bytes that need the schema to decode. In exchange, messages are smaller, parsing is faster, and field types are enforced, so a number cannot silently arrive as a string.

Evolving a schema

Each field has a numbered tag. You can add new fields and old readers ignore them, and you can retire fields without breaking older clients, provided you never reuse a tag number. That discipline is what makes it suit systems where different services upgrade at different times.

Where you meet it

gRPC uses protobuf by default, and many mobile and internal back-end services rely on it. Public web APIs more often stay on JSON because developers can inspect it in a browser.

Trade-offs

Debugging requires a decoder, and browsers need extra tooling. Choose protobuf when volume, latency or strict contracts matter more than easy inspection.

Questions, answered

Usually smaller and faster to parse, though the difference matters mostly at high volume or on slow mobile links.

Yes. It can be stored in files, queues or sent over plain HTTP.

By the Stegnor team · Updated