Protocols
Saved & recent

Protocol Buffers

Also called: Protobuf, proto schema, protobuf serialization

Protocol Buffers, or Protobuf, provides a schema language, generated code and a binary serialization format for structured messages. A .proto definition gives fields types and stable numeric identifiers. It can encode data for a network exchange or a file; it does not establish a connection or deliver messages by itself.

A hypothetical sensor message might define int32 reading = 1 and string unit = 2. Readers use the schema to interpret the encoded fields. When the schema evolves, existing field numbers must not be repurposed. Compatible additions can support gradual upgrades, but compatibility depends on the specific change and encoding.

Related
gRPC, API versioning, Remote procedure call, Apache Avro, Schema evolution
Further reading
.proto schema 1 · reading 2 · unit reserved 3 input values reading: 21 unit: "C" encoder field 1 21 field 2 C schematic binary message decoder reading: 21 unit: "C"
A schema assigns stable field numbers; an encoder writes a binary message and a decoder reconstructs values. The numbered boxes are schematic, not literal encoded bytes. Removed field numbers must not be recycled.

View in the full Protocols collection