Skip to content

The compatible schema that changed the meaning

Failure story 06, in events and replay.

The schema registry accepted the change as fully compatible. Why are reservations now held for more than eight hours instead of 30 seconds?

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
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.

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.

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: holdDurationSeconds
unit: seconds
example:
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.

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.

  • 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.

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
  1. The producer adds holdDurationMs and keeps sending holdDuration (seconds), so every event carries both: holdDuration: 30, holdDurationMs: 30000. 2. Each consumer, on its own schedule, switches to holdDurationMs and runs the worked example against it. 3. The producer team confirms that no consumer reads holdDuration any more, from consumer registrations or from field-level usage metrics, not from asking around. 4. The producer stops sending holdDuration, 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.”

Written and edited by Abhinav Taduka, enterprise software architect.