Episode Summary
Fresh from conducting a hands-on workshop, Martin and Adam share critical insights about event sourcing implementation patterns. They make a strong case against using upcasters for event schema evolution, explaining how this seemingly convenient pattern creates technical debt and complexity. The discussion reinforces the value of keeping implementations simple and boring rather than clever.
Main Discussion Points
- The Case Against Upcasters: Why transforming old event versions to new schemas during reads creates hidden complexity and makes debugging difficult
- Event Schema Evolution: Better strategies for handling event schema changes over time, including weak schema approaches and additive-only changes
- Workshop Format Success: How the concentrated 15-minute block format kept participants engaged and maximized learning outcomes
- Boring Code Wins: Reinforcing that straightforward, predictable code is more valuable than showcasing technical sophistication
- Hands-On Learning Value: Why workshops with actual implementation exercises reveal patterns and anti-patterns that reading alone cannot teach
- Pure Command Handlers: Maintaining functional purity in command handlers by avoiding side effects and keeping all I/O in processors
Key Takeaways
Upcasters represent a tempting shortcut for event schema evolution but create long-term maintenance problems by hiding transformations in the read path. Better approaches include accepting weak schemas, making only additive changes to events, or creating new event types when needed. Workshop participants consistently discover that the simplest patterns - boring, predictable code - lead to the most maintainable systems. The hands-on format reveals implementation pitfalls that theoretical discussions miss.
Memorable Quotes
- “Keep patterns simple and boring - everybody was talking about how important it is to keep things simple to not put any logic into the command Handler” - Martin Dilger
- “Don’t over engineer for scale - most systems don’t need complex solutions for eventual consistency or high performance” - Workshop participant
- “We are solving the problems business has solved decades ago” - Chris Condren
- “It’s so much easier to think about all these single process steps in the timeline than to think about this big bloated thing that coordinates or orchestrates process” - Martin Dilger
- “For almost 10 years now our company’s been around I’ve been doing this since 2008 this problem [eventual consistency] is not a problem” - Adam Dymitruk
Key Learnings
- Avoid reusing read models - create separate purpose-built read models instead of sharing them across workflow steps
- Duplicate lookup tables per context (e.g., separate product lookups for cart vs invoice) to reduce coupling
- Sagas can be deconstructed into simple automation steps (processors) visible in event models
- The five biggest workshop learnings: keep patterns simple, don’t over-engineer, avoid reusing read models, keep events minimal, model in business language
- Infrastructure code in event sourcing rarely changes and doesn’t need frequent testing - focus testing on business logic
Ready to Learn More?
Explore Event Modeling and Event Sourcing in depth with our tutorials and book.
Join our Event Modeling Workshop to get hands-on experience.
Want to learn how to apply Event Modeling and Event Sourcing in practice?
Follow the Online Course “Implementing Eventsourcing” - comes with a Lifetime Event Modeling Toolkit License.