Issues that have to be overcome a. Fragmented study time b. The gap between concept and practices c. Found examples with unfamiliar languages/frameworks d. Stander implementation for Java + Spring + RDMBS Best Practices
is something that has happened in the past. • Conceptually, it should be Immutable. Event Sourcing is about: • Storing facts. • Reading information from the facts for different perceptions.
by Event Sourcing 1. No audit log issue, Information would not be lost, Single source of truth 2. Structure changes more often than behavior => different read model 3. Allows you to time travel (Historic states) 4. Easier to anylize and fix issues. 5. Data analysis
1: OP lock with version Aggregate Table Event Table Reference https://cqrs.wordpress.com/documents/building-event-storage/ Column Name Column Type Id (PK) bigint Type varchar Version bigint CreateDate datetime Column Name Column Type Aggregste (FK) bigint Content blob(json) Version bigint CreateDate datetime
2: Event Table, ( id + parent should be unique) RDBMS Event Store Design 3: Use normal columns to replace context(blob) column Column Name Column Type Id (PK) bigint Content blob(json) Parent (FK) bigint CreateDate datetime
Event Log 2. Snapshots should have their own table 3. Memento pattern better insulates the domain over time as the structure of the domain objects change 4. Frequency of creating snapshots. <= Depends on your requirements Event Sourcing in Practice: Snapshot
https://cqrs.wordpress.com/documents/building-event-storage/ Column Name Column Type Aggregste (FK) bigint content blob Version bigint CreateDate datetime
Boot + MySQL https://github.com/EddieChoCho/event-sourcing-account-management Event Sourcing + Spring Boot + In Memory Event Store https://github.com/Pragmatists/eventsourcing-java-example/tree/projections
3. Choreography-based Saga Pattern Caution! These patterns are fit to be implemented with event sourcing. But they also could be implemented isolatedly.
through http request. 1. Tight coupling 2. Resilience Issue, Multiple points of failures. 3. Response time Order Service CoffeeBean Service CoffeeMaker Service Client
Communication + Server Push Eventual Consistency Order Service CoffeeBean Service CoffeeMaker Service Message Queue Order Topic CoffeeBeen Topic CoffeeMaker Topic Client Command Query
Meanings of Event-Driven Architecture • Martin Fowler Event Sourcing You are doing it wrong by David Schmitz Building an Event Storage - CQRS When Microservices Meet Event Sourcing Sebastian Daschner: Video Course — Event Sourcing, Distributed Systems & CQRS Event Sourcing in Practice - Benjamin Reitzammer & Johannes Seitz Microservice Patterns - Saga Pattern by Chris Richardson Greg Young — A Decade of DDD, CQRS, Event Sourcing
2012 A Journey into CQRS CQRS Tutorial: http://www.cqrs.nu/tutorial/cs/01-design Leave feedbacks twjug slack: CCho twitter: @ChoCho008 Email: [email protected] To Be Continued