Overview
Schema Evolution
Add columns easily, change types painfully, drop columns dangerously.
Why it matters
Forward / backward compatibility decides whether you can deploy producers and consumers independently. Schema registries (Confluent, Apicurio) enforce it at the broker.
Going deeper
Compatibility modes you'll see in a schema registry:
| Mode | Producer can… | Consumer constraint |
|---|---|---|
| Backward | Add optional fields; remove fields with defaults | New consumers can read old + new data |
| Forward | Add fields with defaults | Old consumers can still read new data (ignoring new fields) |
| Full | Only changes safe in both directions | Producers and consumers deploy in any order |
| None | Anything | Caveat emptor; every change is a coordinated release |
Three concrete tactics that keep evolution cheap:
- Default values for every new field — unlocks both directions of compat.
- Deprecate before drop — mark a field deprecated for one release cycle, alert on read access, then drop only after the read counter hits zero.
- Versioned topics / endpoints for breaking changes —
orders.v2alongsideorders.v1, with a documented sunset date for v1.