Joe FRANCOIS
1 min readDec 15, 2024

--

You're welcome, thanks for reading it!

I often work with Event Sourcing, and the way I manage domain versions of an event is by using separate streams. In an Event Driven approach with topics, I would apply the same strategy. As you suggested, I would use a topic for each domain version of the event.

In Event Sourcing, this approach works well because streams remain small, which is important for performance. Additionally, older streams can be easily archived, while newer streams with updated versions remain "alive."

However, applying this approach in an Event-Driven architecture with topics has the following downsides:

Proliferation of topics: The number of topics can grow significantly.

Consumer awareness: Consumers need to know about the new topics to subscribe to them.

On the other hand, this approach has the following advantages:

Clear and decoupled: Each version is handled independently.

Version isolation: Different versions don’t interfere with one another.

Simplified schemas: Each topic can have its own specific schema.

Given these tradeoffs, I would probably choose a hybrid approach: using a topic for each major version and let consumers filter the minor and patch versions.

Hope it helps.

--

--

Joe FRANCOIS
Joe FRANCOIS

Written by Joe FRANCOIS

Tech Lead, Software craftsman, Software Architect. 20+ years of bad code :D

No responses yet