CQRS pitfalls and patterns
summary
Claim: applying CQRS blindly often increases complexity and creates user-visible bugs rather than improving performance. The talk contrasts standard single-database CQRS with eventually consistent CQRS (commands write to one DB, events update a separate query DB), shows how an async query updater and optimistic concurrency produce stale or duplicated records under load (200 concurrent buys against 1,000 inventory became 999), and recommends alternatives: DB replication/sharding, explicit private vs public data flows, pre-charge or negative-inventory business models, and vertical-slice composition.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:00CQRS Pitfalls
- 4:41Best Practices
- 7:10Command Query Separation
- 10:23Domain Models
- 13:21Architecture
- 16:37Standard CQRS
- 20:39Simple CQRS
- 25:18Private vs Public Data
- 31:22Problems with CQRS
- 34:14Vertical Slice Architecture
- 37:49Race Conditions
- 43:17Optimistic concurrency
- 45:46Connection pool
- 52:42Nonblocking
- 55:38Advanced composition
related talks
31mCQRS: Do you really need two databases?
04mCommand Query Responsibility Segregation
52mGoing eventually consistent with CQRS
17m7 Reasons why your microservices should use Event Sourcing & CQRS
46mMicroservices Data Patterns: CQRS & Event Sourcing
50mMoving away from CRUD: DDD + CQRS
40m7 Reasons why your microservices should use Event Sourcing & CQRS
55m7 Reasons why your microservices should use Event Sourcing & CQRS
