Back to DocsRecipe

CQRS Pattern

Command Query Responsibility Segregation splits writes from reads, giving you independent scaling, simpler models, and clear audit trails.

C

Commands

Mutate state. Fire-and-forget or synchronous. One command, one handler. Validate, persist, publish domain events.

Q

Queries

Read-only projections. Denormalized, cached, blazing fast. Query models are disposable — rebuild them from the event stream.

When to use it

  • Read/write workloads are wildly asymmetric
  • You need full audit logs (event sourcing)
  • Multiple read models for different consumers

Meridian tip

Keep your command bus thin. Meridian routes commands by convention —CreateOrderCommandmaps toCreateOrderHandlerautomatically. No reflection, no DI container bloat.