Protocol Buffers
Protocol Buffers is a schema-driven serialization system that represents structured messages as numbered fields in a binary wire format.
Schema: Binary records carry field numbers, wire types and payloads. The message definition supplies field names and declared types; one wire type can represent several schema types. Preserve the relevant schema with long-lived data. [1]
Framing: A top-level message is not self-delimiting. Multiple messages in a file or stream need an external boundary convention, such as length prefixes. Length-delimited fields inside a message do not remove this requirement. [2]
Presence: Implicit presence cannot preserve whether a default-valued basic field was explicitly set. Explicit presence retains that distinction. Proto3 optional basic fields, singular message fields and oneof members track presence; repeated fields and maps do not distinguish empty from absent. [3]
Evolution: Proto3 binary parsing and reserialization preserve unknown fields, but conversion to JSON or field-by-field copying can discard them. Adding fields can be binary-safe while older ProtoJSON readers reject newly populated fields. Ignoring unknown JSON fields avoids rejection, not information loss. [4] [5]
Identity: Deterministic binary serialization is not canonical across schema, build or library changes. Unknown-field retention also does not promise original bytes. Define whether recovery requires byte identity, field presence or application-level values. [6]
Relations
Citations
- Protocol Buffers: Encoding, Message Structure and wire types
- Protocol Buffers: Techniques, Streaming Multiple Messages
- Protocol Buffers: Field Presence, implicit and explicit disciplines
- Protocol Buffers: Language Guide (proto3), Unknown Fields
- Protocol Buffers: ProtoJSON Format, JSON Wire-compatible Changes
- Protocol Buffers: Proto Serialization Is Not Canonical
Sources & caveats
- Primary-source synthesis, not a new native serializer experiment or a compatibility guarantee for every schema change.
- Schema retention and recovery acceptance are engineering implications of the documented encoding, presence and identity contracts.