CQRS stands for Command Query Responsibility Segregation. It is an architectural pattern that separates operations that change application state from operations that read data. Commands handle writes, while queries handle reads.
This separation makes use cases easier to reason about because read concerns and write concerns evolve independently. Rather than putting every operation behind a single service shape, CQRS encourages clearer responsibilities and more maintainable application flows.
CQRS is used in the RawStack API application layer. Command handlers orchestrate state-changing actions, while query handlers focus on fast read paths and response shaping.
CQRS helps keep the codebase modular and easier to scale over time. In RawStack, it supports thin controllers, clearer use-case boundaries, and a practical split between correctness-focused write logic and performance- focused read logic.
copyright © rawstack.io