Year with eventsourcing and CQRS
summary
Practical account of using event sourcing + CQRS on PHP projects: an aggregate with ~10 events loads in ~10ms, a misdesigned monster aggregate grows to 650k events and 700 entities prompting snapshot every 200 events to keep loads under ~100ms, replaying historical data to build a new read model processes 16,000 events in under one minute. Elasticsearch as primary read store causes pain, so migration to MySQL simplifies testing. UUIDs for IDs, queues with shard-by-first-letter to avoid contention, and strong automated tests are mandatory.
AI-written summary · about
chapters (11)
- 0:00Introduction to modern challenges
- 5:00Event sourcing basics explained
- 10:52When to use event sourcing
- 14:55Testing in event-driven systems
- 17:59Performance and snapshotting
- 21:18UUIDs and aggregate roots
- 23:47Class explosion in CQRS
- 26:42Read side modeling and replay
- 28:30Choosing familiar technologies
- 30:00Final recommendations and takeaways
- 31:25Q&A session
