Lesson 18 · Senior gRPC backend engineering

Proto evolution and compatibility

How to change a protobuf contract without breaking old clients, old servers, or the deploy that happens tomorrow morning.

Your win: explain protobuf compatibility the senior way: what is additive, what is breaking, why field numbers matter more than names, and how rollout safety works when old and new binaries overlap in a real fleet.

In plain English Plain English: changing a proto safely is mostly about not surprising code that is still speaking the old version.

The problem: the contract outlives one deploy

A proto change is rarely deployed everywhere at once. One client may already send the new field while another server still runs the old binary. One cron job may restart later. One worker may still have yesterday's image. That is why protobuf evolution is not just syntax. It is compatibility engineering.

If you only read the .proto file in isolation, most changes look innocent. The senior habit is to picture the rollout window: who is still old, who is already new, and what bytes are actually crossing the wire between them?

The rule to memorise Field numbers are the wire identity. If you remember only one thing, remember that. Names help humans; numbers preserve compatibility.

Safe changes vs dangerous changes

This is the part interviewers often probe: can you separate a tidy-looking change from a compatibility-safe change? They are not the same thing.

Anchor — where this matters here This repo uses raw protoc codegen and buf for lint/breaking checks. That means the day-to-day engineer still has to understand the compatibility model instead of assuming the tooling will save every bad change. The tools help, but the rollout judgment is still yours.
Common mistake Thinking a rename is the scary change and a field-number reuse is harmless. It is the other way around.
Read this next

Proto3 guide + update rules

The official protobuf language guide is the right backbone here. Read it with rollout safety in mind.

Proto3 language guide
Updating a message type

Check yourself (from memory)

Q1. The real wire identity of a protobuf field is…

Compatibility lives on the number, not the label.
What is the one-line rule for safe protobuf evolution?
recall, then click to reveal
Preserve existing field-number meaning, add new fields additively, and reserve anything you remove so old wire data is never misread later.
Want me to walk through a concrete “safe vs unsafe” proto diff line by line, the way we would in review? Ask me.

Sources. Proto3 guide.