Renato Mefi
04/13/2022, 5:33 PMIn a microservices context, If one microservice needs to change the schema of the data sent to downstream consumers, how would be a good approach towards evolving that microservice’s message schema?I’ll try to be quick on this one Hopefully you can keep full transitive schemas, see picture However if you can’t, you have to consider publishing messages in 2 formats until the downstream services can update, although this is a “producer” driven problem, it’s important to get all consumers compliant before doing such a change, if you’re at least forward compatible then you can ship changes all the time. Another practice is to have a completely new schema, and produce to a new queue/topic, doing multiple writes until consumers can move, or keep that forever. A third one is upcasting events for instance, produce the old version, upgrade it and produce to another topic, consumers then can choose what to consume. There might be a mix between them as well, ofc depends on the use case.