Schema Evolution Between Writers and Readers

Evaluate compatibility by applying a reader’s schema to previously written data, and treat defaults as part of decoding semantics.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Readers need rules for fields absent in older records
  2. Check both directions during a rolling change

Readers need rules for fields absent in older records

A new reader may expect a field never written by the old schema. Depending on the format, a defined default can supply its value. A default does not mean writers always omit that field, and it need not mean the source application actually observed the default value. Dropping a field may be compatible for readers that ignore it and incompatible for other contracts.

Check both directions during a rolling change

A deployment can have old readers seeing new records and new readers seeing old records at the same time. A type change or field rename needs the format’s explicit resolution rules. Test sample data across the versions and check how unknown variants are handled. Canonical parsing controls interpretation at one boundary. Change capture keeps historical events that bring those earlier schemas back during replay.[1][2]

References

  1. Apache Avro, Specification and Schema Resolution ↩
  2. Apache Beam, Programming Guide ↩