All aboard the Service Bus
summary
CQRS splits write and read logic so a single use case like updating a product price becomes a small validated command object handled by one command handler, which updates a write store and emits a product price updated event handled by zero or more listeners; recommended PHP libraries are Prooph Service Bus, Simple Bus and Tactician, and Chimera PHP provides middleware plumbing. Commands are always valid, one-to-one with handlers; events are immutable and unordered; query buses exist but add typing and boilerplate and are mainly useful when aggregating multiple data sources or throttling requests.
AI-written summary · about
chapters (14)
- 0:00Start
- 0:08All aboard the Service Bus!
- 6:57Before CQRS
- 21:23A command is always valid
- 22:42Dispatching commands, HTTP
- 23:14Dispatching commands.CLI
- 23:36Command handlers
- 29:47An event holds primitives
- 31:05Dispatching events
- 32:33Event listeners
- 35:45A query is always valid
- 36:23Dispatching queries
- 36:40Query handlers
- 40:02ChimeraPHP
related talks
04mCommand Query Responsibility Segregation
39mEvents in Our Applications: Event Bus and Distributed Systems
59mA CQRS Approach with Api Platform and Symfony Messenger
40mClean Microservices Communications with CQRS and Event Sourcing
30mDomain-Driven Design + Command Query Responsibility Segregation + Event Sourcing
40mDDD, CQRS, Hexagonal, Onion,... Putting it together
59mCQRS pitfalls and patterns
29mApplying (D)DDD and CQ(R)S to Cloud Architectures
