CQRS and Event Sourcing explained
summary
Argues for modeling immutable happenings instead of mutable state and shows working PHP code that replays events into an object and into read-side projections. Demonstrates a simple counter domain, an append‑only event store (MySQL or Kafka suggested), and a projector that prebuilds HTML; the full example plus storage is roughly 300 lines of code. Claims this makes caching trivial, reproduces past states to debug, and scales read traffic by serving precomputed projections.
AI-written summary · about
chapters (11)
- 0:00Introduction and setup
- 1:50The problem with state
- 5:40Temporal data and challenges
- 9:47Introduction to event sourcing
- 12:39Immutability and event logs
- 17:36Real-world examples
- 22:50Implementation details
- 28:33Event store and performance
- 35:40CQRS fundamentals
- 40:40Projections and query optimization
- 45:24Conclusion and resources
related talks
01h 07mAn Architecture with CQRS and Event Sourcing
49mCQRS and Event Sourcing: Higher-Level Software Architecture for Everyone!
52mEvent Sourcing and CQRS
25mCQRS and Event Sourcing: May the Event Be with You
43mEvent Sourcing dealing with an eventful past
01h 25mBuilding microservices with event sourcing and CQRS
36mThe Good, The Bad and The Ugly - An Event Sourcing Retrospective
40mEvent Sourcing: the good, the bad and the complicated
