protocolbuffers/protobuf

Developer Tools

A schema-first serialization format for teams that need typed, versionable data contracts across services and languages.

72,130
16,328
C++
NOASSERTION
12 years old

Protobuf is worth adopting when you have a real interface contract to maintain across services or languages, and it is a poor first choice for a small script or a payload you send once. The repository is Google's canonical implementation of the format, including the protoc compiler and language runtimes.

The problem

A team starts with JSON: someone writes a payload, another service reads it, and the field names are agreed in chat. When a field gets renamed, a number flips between string and int, or a new consumer arrives in another language, the mismatch surfaces at runtime. With protobuf, the schema lives in a .proto file, and that file is the unit both sides build from. The change happens at the schema step: you edit the file, regenerate code for each language, and the compiler rejects malformed definitions before deploy. The result is a typed, versionable contract rather than an informal convention.

What's different

Protobuf separates the schema from the generated code. protoc turns .proto definitions into typed classes for C++, Java, Python, and the other supported runtimes, so each service gets native accessors instead of hand-parsing bytes. The wire format is compact and explicitly versioned: field numbers, not field names, travel on the wire, which is what makes additive schema evolution possible.

That design has a cost. The toolchain is a second build step, and the README is explicit that you need both protoc and a runtime for your language. For C++, you build from source, and the README warns that the head of main can break source compatibility, so it tells you to pin a release commit on a release branch. For everyone else, pre-built binaries are available from releases. Cross-language work also splits across repositories: Go, JavaScript, and Dart live in separate projects, so versioning is not entirely one-stop.

Editions, the newer way to express schema behavior, was the subject of an author's blog post shared when v27.0 shipped. Treat that as material describing a schema-model change, not an argument for migrating immediately.

Who should try it

Good fit: a backend team exposing an API to several client languages, or a platform group that owns shared event schemas and wants compile-time checks when a producer and consumer disagree. A second good fit is a C++ codebase that already builds with Bazel, since the README documents bazel_dep integration with Bzlmod and a WORKSPACE path.

Poor fit: a solo developer prototyping a small service, or a project whose entire data contract is one JSON blob consumed by one program. The schema-plus-codegen loop adds files and a build dependency before it saves anything.

Requirements and limitations

The main setup cost is the compiler/runtime pair. Non-C++ users can grab a protoc-$VERSION-$PLATFORM.zip from releases, but C++ users must follow the C++ build instructions. Mixing versions between protoc and a runtime is a real failure mode, so pin both.

Ongoing upkeep matters more than initial setup. The README's support policy lives on a separate version support page, and the README warns that release branches can be unstable between release commits. If you vendor from main, expect occasional breakage; if you pin, plan the upgrade cadence yourself.

HotRepo's take

HotRepo's only observations are 2026-10-24 and 2026-10-25, each showing +3 stars, on the daily board both days. That is two dated snapshots, not evidence of momentum either way; persistence cannot be judged from it. For a project this old, the decision is not about trend. Before committing, check the version support page for how long your chosen language runtime stays supported, since that, not popularity, determines your upgrade burden.

Hacker News

Show HN: Protobuf Editions now available in v27.0
▲ 3 · 2 comments · May 24, 2024
How to learn to use protoc in 21 easily infuriating steps
▲ 3 · 0 comments · August 12, 2023
Μpb: Small, Fast C Protobufs
▲ 2 · 0 comments · January 6, 2025

Written by AI from the project's README, updated October 25, 2026. The project's own docs are the source of truth.