CQRS Architecture

Mechanics

Workflow

  1. When a user performs an action, the application sends a command to the command service.
  2. The command service retrieves any data it needs from the command database, makes the necessary manipulations and stores that back in the database.
  3. It notifies the read service so that the read model can be updated.
  4. When the application needs to show data to the user, it can retrieve the read model by calling the read service.

https://blog.ndepend.com/wp-content/uploads/layered-3.png

https://blog.ndepend.com/wp-content/uploads/Layered-4.png

CQRS Principles

Basic CQRS