It is dangerous because the change is silent. The schema stays technically compatible, so no schema registry or type check will catch it. But every existing consumer now computes wrong numbers without any error. A consumer is a service that reads the event.
Old messages in the topic also still carry the old meaning. So a replay (reading old messages again) mixes both meanings. Never give an existing field a new meaning, and never reuse a field name.
When you only need to add something: add a new field, such as subtotal, and keep total as it was. This is a compatible change. Each consumer starts using the new field when it is ready.
For a true breaking change:
- Publish a new event version, such as
OrderPlaced.v2or a new topic, next to the old one. - The producer writes both versions for a migration period.
- Consumers move to v2 one by one.
- Track which consumers still read v1.
- Retire v1 once nobody reads it.
Document the change and its dates, because the consumers belong to other teams.
- Changing a field's meaning is invisible to schema checks and breaks consumers silently.
- Old messages keep the old meaning, so a replay mixes both meanings.
- To add something, add a new field and keep the old one.
- For a breaking change, publish a new version or topic, write both, move consumers over, then retire v1.
- Tell the consuming teams about the change and its dates.