Glossary · 2 · Developer SDKs and APIs
Protocol Buffers
Also known as: Protobuf, protobuf
In software engineering, Protocol Buffers (Protobuf) is a language-neutral, platform-neutral mechanism originally developed at Google for defining structured data and service interfaces in `.proto` files and serializing that data in a compact binary format, with a compiler that generates code for many programming languages.
- Developer SDKs
In one sentence
Protocol Buffers (Protobuf) defines data and services in .proto files, serializes data in a compact binary format and generates code for many languages.
Example
A machine vendor defines its telemetry messages in a `.proto` file; the gateway firmware in C++ and the cloud service in Go use code generated from the same file.
How it applies
- Developer SDKs:
.protofiles are the interface definition behind gRPC services and many binary APIs. The protocol compilerprotocand its plug-ins generate message classes and client stubs, a form of automatic code generation; SDKs ship the generated code or let users generate it. - Serialization: Protobuf is a binary serialization format; messages are smaller and faster to parse than text formats such as JSON, but not human-readable without the schema. A JSON mapping (ProtoJSON) exists for debugging and HTTP use.
- Evolution: Fields are identified by numbers, not names. New fields can be added and unknown fields are skipped, so old and new versions can exchange messages if field numbers are never reused. These rules belong in the interface contract.
- Hardware SDKs: Device and edge software uses Protobuf for compact messages between devices, gateways and cloud services.
- Interoperation: The OTLP protocol of OpenTelemetry is defined in Protocol Buffers, which lets telemetry cross language and vendor boundaries.
- Documentation: Reference documentation is often generated from comments in the
.protofiles; the language syntax used (proto2, proto3 or editions) should be stated.
Protocol Buffers vs. JSON Schema and OpenAPI
Protocol Buffers defines both the schema and a binary wire format; code generation is the normal way to use it. JSON Schema and OpenAPI describe text-based JSON payloads and HTTP operations; generated code is optional. Many systems use both: Protobuf between internal services and OpenAPI-described JSON at the public edge.