Protocol Buffers (Protobuf)
Protocol Buffers is Google's language-neutral serialization format for structured data. It is more compact and faster than JSON or XML, and it uses schema definitions (.proto files) to generate type-safe code in dozens of programming languages.
MIME Type
application/x-protobuf
Type
Binary
Compression
Lossless
Advantages
- + 10-100x smaller and faster than JSON/XML
- + Schema-driven with generated type-safe code
- + Backward-compatible schema evolution via field numbers
- + Standard wire format for gRPC
Disadvantages
- − Not human-readable — binary format requires tooling
- − Requires .proto schema definition and code generation step
- − Not suitable for human-edited configuration files
When to Use .PROTOBUF
Use Protobuf for gRPC services, internal microservice communication, and any system needing fast, compact, schema-driven serialization.
Technical Details
Protobuf uses a .proto schema with numbered fields that compile to language-specific code. The binary wire format uses varint encoding for integers and length-delimited encoding for strings and nested messages.
History
Google developed Protocol Buffers internally and released it as open source in 2008. Proto2 added optional fields, and Proto3 (2016) simplified the language with default values. gRPC uses Protobuf as its default wire format.