Protocols
Saved & recent

Schema evolution

Also called: schema compatibility, backward-compatible schema, forward-compatible schema

Schema evolution changes the structure of exchanged data while managing compatibility between old and new software. Compatibility has a direction: can a new reader understand old data, and can an old reader handle new data? A rolling deployment may need both, because different versions coexist for a time.

In Protocol Buffers, adding a new field can preserve binary decoding while an older reader ignores the unfamiliar field. Reusing a deleted field number can instead give old bytes a different meaning, so removed numbers should be reserved. Even a wire-compatible change can break application assumptions. Teams must check required meaning and defaults, and distinguish binary compatibility from the rules of other representations such as JSON.

Read first
Serialization
Related
Protocol Buffers, Apache Avro, Schema registry
Further reading
Protocol Buffers — updating a proto3 message type
binary decoding example old reader new reader old writer new writer id id id id, label Protobuf v1 field 1 · id Protobuf v2 field 1 · id field 2 · label old reader uses field 1 application meaning check behavior after decoding
A new field can preserve binary decoding in both deployment directions while still changing what the application needs to understand.

View in the full Protocols collection