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