CQRS04 Feb 2019
CQRS vs. CQS
Command query responsibility segregation (CQRS) applies the CQS principle by using separate Query and Command objects to retrieve and modify data, respectively.
- CQS acts at component (micro) level - it’s about having different functions for reading and writing
- CQRS acts at context (macro) level - it’s about having different paths to process request
=> CQRS is not just about mechanical splitting read and write functions - it’s a comprehensive approach to processing requests which can include many aspects (say, read and write operations might even use different stores).
CQRS vs. ES
Event Sourcing is optional and in most cases complicates things more than it helps if introduced too early.
event sourcing is a completely orthogonal concept to CQRS
in CQRS you don’t have to use ES but this combination is quite popular so more often than not when people speak about CQRS they mean using ES as well.