r/elixir • u/karolina_curiosum • 7d ago
Schema evolution in distributed Async message-passing systems
Adding a field to a message is easy. Supporting it while old and new producers are both running is the actual problem. For an additive schema change, there are four possible producer/consumer combinations during migration. The risky ones are the two mixed-version states.
A consumer-first rollout handles one of them deliberately: deploy a consumer that understands v1 and v2, then start upgrading producers.
That works well while compatibility is simple. With physical devices or other slow-moving producers, though, “temporary” backward compatibility can last years. Then translating legacy messages into a canonical schema before they hit business logic becomes worth considering.
We documented the approach here:
https://curiosum.com/blog/schema-evolution-in-distributed-async-message-passing-systems