← Back to RawStack

CQRS

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.

Where is it used in the stack?

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.

Why are we using it?

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.

Find out more

  • Microsoft's CQRS pattern guide is here
  • The RawStack API docs explain how CQRS is applied here

Start building now!

Give you or your team a production-ready foundation for web and mobile apps, with performance, scalability, and maintainability built in.

npx create-rawstack-app@latest

copyright © rawstack.io