Especificación Protocol Buffers
Protocol Buffers son Google's language-neutral, platform-neutral binary serialization formatear con .proto schemas.
Schema and Encoding
Protocol Buffers use .proto schema files defining messages with typed fields. Fields are encoded as tag-length-value triples in a compact binary format. Varint encoding compresses small integers efficiently. Repeated, optional, and map fields are supported. The format is not self-describing; the schema is needed to decode. Proto3 simplifies the syntax by removing required fields and explicit defaults.
- .proto schema
- Field definitions
- TLV encoding
- Tag-length-value
- varint
- Variable-length ints
message Person { ... } compact binary small ints = 1 byte Evolution and Ecosystem
Protobuf supports forward and backward compatibility by following field-number rules. New fields can be added; old fields can be reserved but not reused. gRPC uses protobuf for service definitions and wire format. The format is used across Google APIs and many microservice architectures. Code generators produce typed bindings for 15+ languages. Protobuf is the dominant RPC serialization format.
- compatibility
- Add fields freely
- gRPC
- Service definitions
- codegen
- 15+ languages
never reuse numbers HTTP/2 transport typed bindings