Programming Guides

Learn how to use Protocol Buffers in your projects.

Language Guide (editions)

Covers how to use the edition 2023 revision of the Protocol Buffers language in your project.

Language Guide (proto 2)

Covers how to use the proto2 revision of Protocol Buffers language in your project.

Language Guide (proto 3)

Covers how to use the proto3 revision of the Protocol Buffers language in your project.

Proto Limits

Covers the limits to number of supported elements in proto schemas.

Style Guide

Provides direction for how best to structure your proto definitions.

Enum Behavior

Explains how enums currently work in Protocol Buffers vs. how they should work.

Encoding

Explains how Protocol Buffers encodes data to files or to the wire.

ProtoJSON Format

Covers how to use the Protobuf to JSON conversion utilities.

Techniques

Describes some commonly-used design patterns for dealing with Protocol Buffers.

Third-Party Add-ons

Links out to many open source projects that seek to add useful functionality on top of Protocol Buffers.

Extension Declarations

Describes in detail what extension declarations are, why we need them, and how we use them.

Application Note: Field Presence

Explains the various presence-tracking disciplines for protobuf fields. It also explains the behavior of explicit presence-tracking for singular proto3 fields with basic types.

Proto Serialization Is Not Canonical

Explains how serialization works and why it is not canonical.

No Nullable Setters/Getters Support

Covers why Protobuf doesn’t support nullable setters and getters

Proto Best Practices

An overview of best practices topics.

Proto Best Practices

Shares vetted best practices for authoring Protocol Buffers.

API Best Practices

A future-proof API is surprisingly hard to get right. The suggestions in this document make trade-offs to favor long-term, bug-free evolution.

1-1-1 Best Practice

All proto definitions should have one top-level element and build target per file.