Encoding & Schema Evolution
7 min read.
Send records between old and new code with tag-based encoding: add a field safely, see a reused tag corrupt data, and keep unknown fields through a rolling upgrade.
Think of it this way: Field tags are like numbered boxes on a paper form. An old clerk who gets a newer form with an extra box 3 just ignores box 3. A new clerk reading an old form leaves box 3 at its default. But if box 2 used to mean email and now means phone, every old form gets misread without anyone noticing.
Version 2 of the app adds an age field with tag 3. Old and new code will run side by side for a while.
Check your understanding
Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.
Safe or unsafe schema change?
Sort each change to a Protobuf-style schema by whether old and new code can keep talking.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
Safe
Drop items hereBreaks compatibility
Drop items hereQuiz
11 questionsBackward compatibility means…
Done with this lesson?
Sign in free to keep your progress, streak and quiz scores.