Real-World Case Studies: Data Encoding and Schema Evolution

✅ Source-checked. Each deep dive names its source, and we kept only what that source says. Found an error, or something the source doesn't support? Report it on the tracking issue.

Two ways to keep old and new code talking: Protocol Buffers tag every field with a permanent number, while Avro sends no field identifiers at all and relies on the reader knowing the writer's schema, which is what a schema registry is for.


🏢 Deep Dive 1: Protocol Buffers at Google

Sources: protobuf.dev: Overview, History, Language Guide (proto3). Everything in this section comes from those pages.


🪶 Deep Dive 2: Apache Avro, No Tags on the Wire

Source: the Apache Avro 1.11.1 specification. Everything in this section comes from it.


🗃️ Deep Dive 3: Confluent Schema Registry, Finding the Writer's Schema

Sources: Confluent docs, Schema evolution and compatibility and Formats, serializers and deserializers. Everything in this section comes from those pages.

ℹ️ An earlier version of this page said "100%" of Google's internal traffic uses Protocol Buffers at "billions of RPCs per second", and that LinkedIn and Netflix move "1.5 trillion events per day" through Avro. The sources above don't support those figures, so we removed them.


⚖️ Side by Side

Protocol Buffers Avro + Schema Registry
How a field is identified A permanent field number on the wire Its name, matched between writer and reader schemas
What travels with each message Field numbers with the values A 4-byte schema ID, then bare values
Main evolution rule Never change or reuse a field number Give new fields defaults, and let the registry check compatibility

🎯 System Design Interview Takeaways

  1. Rolling deploys need both directions. New code must read old data (backward compatibility), and old code must read new data (forward compatibility).
  2. With Protobuf, the number is the contract. Names are for humans. Never change or reuse a field number, and reserve deleted ones.
  3. With Avro, defaults are the contract. Add fields with defaults, and use a registry so consumers can always find the writer's schema.