SmartIPlace’s Post

View organization page for SmartIPlace, graphic

38,086 followers

Event-driven architecture (EDA) is exciting until you deal with event versioning. The solution is a pattern, an Adapter, but with a twist. (Like 90% of the problems in Software Development) The Problem Your schema changed with some breaking changes. You have to update your Producer and 3 of your consumers. You may think you can have coordinated deployments. Good luck; you will be stuck in 27 meetings, and something will go wrong.  A Solution Create a new Topic; use this topic to publish the new schema versions. Update the producer to generate the new schema and point it to the new topic. Create an Adapter listening for messages in the New Topic and translating the message to the old format, then saving it into the old topic. Start migrating the consumers and pointing them to the New Topic. Once you finish the migration, you can decommission the Adapter and get rid of the old topic. Benefits The Adapter ensures backward compatibility, allowing existing consumers to continue functioning. This allows for a gradual migration of consumers to the new event schema. There is no big coordinated deployment with downtimes and no endless meetings. Testing will be more focused and controlled, as each consumer's transition can be tested independently.

  • No alternative text description for this image

To view or add a comment, sign in

Explore topics