The compatible schema that changed the meaning
Failure story 06, in events and replay.
The challenge
Section titled “The challenge”The schema registry accepted the change as fully compatible. Why are reservations now held for more than eight hours instead of 30 seconds?
The setup
Section titled “The setup”| Assumption | Value |
|---|---|
| Event | SeatHeld { seatId, holdDuration: integer } |
| Meaning, never written down | holdDuration is in seconds; the standard hold is 30 |
| Producer change | A new team standardizes on milliseconds and sends holdDuration: 30000 |
| Check in the pipeline | The schema registry verifies the new schema is backward compatible |
| Consumers | Three services, which expire the hold at heldAt + holdDuration seconds |
What happened
Section titled “What happened”| Step | What happens |
|---|---|
| 1 | The producer’s new schema is identical: same field name, same type. The registry approves it. |
| 2 | The new producer is deployed and sends holdDuration: 30000. |
| 3 | Every consumer reads 30,000 seconds: 8 hours and 20 minutes. |
| 4 | Customers who abandon checkout keep their seats until the evening. Popular events show sold out with most seats empty. |
| 5 | Monitoring shows no errors: every message is valid and every consumer is healthy. |
Why it went wrong
Section titled “Why it went wrong”A schema describes shape: names, types, required fields. Compatibility checks answer can the consumer parse this? They can’t answer does the consumer understand this the same way?, because units, time zones, currencies, sign conventions and enumerations’ meanings usually live only in someone’s head. A change that keeps the shape and changes the meaning is the most dangerous kind, because every automated check passes.
Two designs
Section titled “Two designs”| Aspect | Design A: schema-only check | Design B: a contract with units and examples |
|---|---|---|
| What’s published | The schema | The schema plus each field’s meaning, unit and worked examples |
| How the unit is carried | Nowhere | In the name (holdDurationSeconds) or the value ("PT30S", an ISO 8601 duration) |
| Changing the unit | Edit the producer | Add a new field, publish both, migrate consumers, then remove the old one |
| What the pipeline tests | Can it parse? | Can it parse, and does each consumer compute the right result from the published examples? |
A worked example turns a meaning into something a test can check:
field: holdDurationSecondsunit: secondsexample: given: { heldAt: "2026-11-21T10:00:00Z", holdDurationSeconds: 30 } expect: { expiresAt: "2026-11-21T10:00:30Z" }Each consumer runs the example against its own expiry code in its own pipeline. The producer runs it against the messages it actually produces.
The check
Section titled “The check”Build a matrix of every supported producer version against every consumer version.
| Aspect | Consumer v1 | Consumer v2 |
|---|---|---|
| Producer v1 | expires at 30 s? | expires at 30 s? |
| Producer v2 | expires at 30 s? | expires at 30 s? |
Expected: a 30-second hold expires at 30 seconds in every cell. Under Design A, the producer-v2 row fails for every consumer that wasn’t changed, and no schema check notices.
This check is in the checks catalog as test templates in Java and Python.
When the simpler design is enough
Section titled “When the simpler design is enough”- One team owns the producer and every consumer, and they deploy together. Then meaning lives in one codebase and one set of tests.
- The field’s meaning genuinely can’t vary: an identifier, or a boolean whose name says exactly what it means.
For educators
Section titled “For educators”Discussion question. Make a list of meanings in your own event payloads that the schema doesn’t capture. Typical candidates: units, time zones, currencies, whether amounts include tax, rounding, and what null means.
Exercise. The producer must move to milliseconds without breaking any consumer, and the three consumer teams will migrate over the next two months. Write the sequence of releases.
Worked answer
- The producer adds
holdDurationMsand keeps sendingholdDuration(seconds), so every event carries both:holdDuration: 30, holdDurationMs: 30000. 2. Each consumer, on its own schedule, switches toholdDurationMsand runs the worked example against it. 3. The producer team confirms that no consumer readsholdDurationany more, from consumer registrations or from field-level usage metrics, not from asking around. 4. The producer stops sendingholdDuration, and later removes it from the schema. This is the parallel change (expand and contract) pattern. The step teams most often skip is 3: removing the old field because “everyone said they’d migrated.”
Further reading
Section titled “Further reading”- NASA’s Mars Climate Orbiter (opens in a new tab) mission page. The spacecraft was lost in 1999 after one team’s software produced results in English units while another’s expected metric.
- Martin Fowler on parallel change (opens in a new tab).
Related pages
Section titled “Related pages”Written and edited by Abhinav Taduka, enterprise software architect.
New pages are added regularly. Follow Abhinav on LinkedIn to see them first.