All templates

CQRS Architecture Diagram Template

Diagram a CQRS architecture — command side, query side, event bus, and projector building read models.

Use this template

What you get

  • Command side: handler, write model, event store
  • Query side: handler, read model, projector
  • Event bus bridging the two with eventual consistency

What this template is for

A CQRS (Command Query Responsibility Segregation) architecture diagram shows how a system separates writes from reads using two distinct models connected by events. This template lays out the canonical CQRS shape: a command side that handles writes through command handlers and a write model (often event-sourced), an event store, an event bus that publishes events, a projector that listens and updates the read model, and a query side that serves reads from the optimized read model. Use it to design a CQRS service, explain the eventual consistency between write and read, or document why a single API endpoint splits into two backend paths.

When to use this template

  • Design a CQRS service before writing the first command handler.
  • Explain why writes go through one path and reads through another.
  • Document the projection step that builds the read model from events.
  • Plan the eventual-consistency boundary between command and query sides.
  • Trace a stale read: did the projector lag, fail, or fall behind?
  • Compare CQRS against a single-model (CRUD) approach to justify the complexity.

How to use it

  1. 1Start with the client and API gateway routing commands and queries.
  2. 2Draw the command side: command handler, write model, event store.
  3. 3Draw the query side: query handler, read model, projector.
  4. 4Add an event bus between them that publishes events from the store.
  5. 5Connect the projector to the bus and to the read model.
  6. 6Label the consistency boundary — eventual between write and read.

Quick example

Order service with CQRS

Client → API → Command Handler → Write Model → Event Store
Event Store → Event Bus (OrderPlaced, OrderShipped)
Projector consumes events → updates Read Model
Client → API → Query Handler → Read Model (no joins, indexed)
Write and read scale and deploy independently

Start editing online

Open the template in CodePic, replace the sample nodes, and turn it into your own study board in a few minutes.

See examples: /templates/cqrs-architecture/examples

More templates you might like