Protocol Buffers (protobuf) is a language-neutral, platform-neutral data serialization format developed by Google that encodes structured data into a compact binary format, significantly smaller and faster than text-based formats like JSON or XML. You define data structures in .proto files using a schema language specifying field names, types, and numbers. The protobuf compiler generates source code in your target language (Python, Java, Go, etc.) with classes for each message type and methods for serialization and deserialization. Binary encoding reduces payload size typically by 3-10x compared to JSON, and parsing is 20-100x faster because there's no text parsing overhead. Field numbers (not names) identify data in the binary format, enabling schema evolution: you can add new fields without breaking old code, and old fields can be deprecated while maintaining backward compatibility. These versioning guarantees make protobuf ideal for APIs and storage formats that evolve over time. The tradeoff is human-readability: binary protobuf data is not inspectable without the schema. Debugging requires tooling. But for high-performance systems transmitting large volumes of structured data, protocol buffers are significantly more efficient than text alternatives. gRPC uses protobuf as its default serialization format.
Back to Glossary