Protocol Buffers
Subject: Computer and Technology noun /ˈproʊ.təˌkɔːl ˈbʌf.ərz/ 1 definition
- data-serialization
- distributed-systems
- software-engineering
- computer-networking
-
Definition (noun)
Entry #180 · UpdatedProtocol Buffers (Protobuf) is a language-neutral, platform-neutral data serialization mechanism developed by Google that uses
.protointerface definition files to generate strongly typed code and encode structured messages into a compact binary wire format. Instead of embedding field names in payloads like self-describing text formats such as JSON or XML, Protobuf identifies fields by numeric tags, reducing message size and parsing overhead while supporting backward- and forward-compatible schema evolution across services and storage.Common Forms
proto2: The original schema syntax supporting explicit field presence (
requiredandoptional), custom default values, and message extensions.proto3: A streamlined schema syntax that omits
requiredfields and custom defaults while standardizing canonical JSON mapping and broad cross-language support.Protobuf Editions: The unified specification model that replaces discrete
proto2andproto3syntax forks with opt-in feature flags for incremental language evolution.Binary, Text, and JSON Encodings: The primary compact binary wire format used for runtime efficiency, paired with human-readable Textproto and JSON mappings for configuration, debugging, and HTTP gateways.
Example
A payment platform defines a
Transactionmessage intransaction.protowith numbered fields likestring id = 1;andint64 amount_cents = 2;, then compiles it withprotocinto Go and Python classes. Services exchange compact binary payloads over gRPC with lower overhead than JSON, and can later add fields such asstring currency = 3;without breaking older consumers.