Event Sourcing Without a Framework: A Practical Approach
Introduction
In his Devoxx France 2023 quickie, “Et si on faisait du Event Sourcing sans framework ?”, Jonathan Lermitage, a developer at Worldline, challenges the reliance on complex frameworks for event sourcing. This 17-minute talk explores how his team implemented event sourcing from scratch to meet the needs of a payment processing system. Lermitage’s practical approach, grounded in Worldline’s high-stakes environment, offers developers a clear path to adopting event sourcing without overwhelming dependencies.
Key Insights
Lermitage begins by explaining event sourcing, where application state is derived from a sequence of events rather than a static database. At Worldline, which processes millions of transactions daily, event sourcing ensures auditability and resilience. However, frameworks like Axon or EventStore introduced complexity that clashed with the team’s need for simplicity and control.
Instead, Lermitage’s team built a custom solution using:
-
PostgreSQL for Event Storage: Storing events as JSON objects in a single table, with indexes for performance.
-
Kafka for Event Streaming: Ensuring scalability and real-time processing.
-
Java for Business Logic: Simple classes to handle event creation, storage, and replay.
He shares a case study of tracking payment statuses, where events like PaymentInitiated or PaymentConfirmed formed an auditable trail. Lermitage emphasizes minimalism, avoiding over-engineered patterns and focusing on readable code. The talk also covers challenges, such as managing event schema evolution and ensuring idempotency during replays, solved with versioned events and unique identifiers.
Lessons Learned
Lermitage’s experience offers key takeaways:
-
Keep It Simple: Avoid frameworks if your use case demands lightweight solutions.
-
Prioritize Auditability: Event sourcing shines in systems requiring traceability, like payments.
-
Plan for Evolution: Design events with versioning in mind to handle future changes.
These insights are valuable for developers in regulated industries or those wary of framework lock-in. Lermitage’s focus on practicality makes event sourcing approachable for teams of varying expertise.
Conclusion
Jonathan Lermitage’s talk demystifies event sourcing by showing how to implement it without heavy frameworks. His Worldline case study proves that simplicity and control can coexist in complex systems. This quickie is a must-watch for developers seeking flexible, auditable architectures.