seniorpatterns
Command Query Responsibility Segregation — separating read and write models.
CQRS splits the system into Command (write) and Query (read) sides with different data models. The write model is optimized for consistency (normalized DB). The read model is optimized for performance (denormalized, materialized views). Synchronization happens through events. Often used with Event Sourcing.
When yes
Read/write ratio > 10:1, different requirements for read and write models
When no
Simple CRUD, small applications (overhead is not justified)
Interview tip
CQRS is not for everyone. Apply it only when there's a clear need
Alt:Simple CRUDRead replicas