Skip to main content
Definition Website Computer and Technology

Protocol Buffers

Subject: Computer and Technology noun /ˈproʊ.təˌkɔːl ˈbʌf.ərz/ 1 definition

  1. Definition (noun)

    Entry #180 · Updated

    Protocol Buffers (Protobuf) is a language-neutral, platform-neutral data serialization mechanism developed by Google that uses .proto interface 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 (required and optional), custom default values, and message extensions.

    • proto3: A streamlined schema syntax that omits required fields and custom defaults while standardizing canonical JSON mapping and broad cross-language support.

    • Protobuf Editions: The unified specification model that replaces discrete proto2 and proto3 syntax 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 Transaction message in transaction.proto with numbered fields like string id = 1; and int64 amount_cents = 2;, then compiles it with protoc into Go and Python classes. Services exchange compact binary payloads over gRPC with lower overhead than JSON, and can later add fields such as string currency = 3; without breaking older consumers.