Episode Summary
Martin and Adam explore why keeping event sourcing implementations simple is more valuable than adopting complex patterns. They deconstruct the saga pattern, demonstrating how event modeling’s basic command-event-state flow handles most distributed transaction scenarios without additional orchestration complexity. The discussion emphasizes that simplicity in architecture leads to more maintainable and understandable systems.
Main Discussion Points
- Simplicity Over Patterns: The danger of pattern soup - adopting complex patterns like sagas, CQRS variations, and orchestration frameworks when simple command-event-state flows suffice
- Saga Deconstruction: How most saga use cases can be modeled as straightforward event-driven workflows using to-do list processors without dedicated saga frameworks
- Event-Driven Choreography: Natural workflow coordination through events and processors eliminates the need for centralized orchestration in most business scenarios
- Command Handler Purity: Keeping command handlers purely functional and side-effect-free, with all external interactions happening through events and processors
- Pattern Resistance: Why developers should resist the urge to adopt sophisticated patterns prematurely, focusing instead on the three basic event modeling building blocks
- Boring Code Philosophy: Embracing “boring” code that’s straightforward and easy to understand over clever implementations that showcase technical prowess
Key Takeaways
Event modeling’s fundamental patterns - commands triggering events, events building state, and processors reacting to events - handle the vast majority of business scenarios without additional complexity. The saga pattern, while useful in specific distributed transaction contexts, is often unnecessarily applied to problems better solved through simple event choreography. Keeping implementations boring and predictable reduces cognitive load and makes systems more maintainable over time.
Memorable Quotes
- “We’ve made programming boring again” - Rob (quoted by Martin Dilger)
- “Eventual consistency is almost a nonissue” - Workshop participant
- “Test cases for processes should almost be unnecessary” - Workshop participant
- “Don’t use upcasters” - Workshop participant/Yordis
- “If you test your command handlers and if you test your read models and if you test everything in your slice the processor is basically not doing too much” - Martin Dilger
Key Learnings
- Making programming “boring” through predictable patterns is a feature, not a bug - it creates reliability
- Eventual consistency is rarely an actual problem in real-world systems; businesses are naturally eventually consistent
- Events should contain only minimal information needed to show state changes, not redundant data
- Upcasters centralize decision-making inappropriately; handling multiple event versions directly is more honest
- The workshop format of 15-minute focused blocks with hands-on practice proved highly effective for learning
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.