Command Query Responsibility Segregation (CQRS) is often used alongside event sourcing. CQRS consists of two parts:
- The writing part receives state-update commands and stores them in an underlying event store, but does not return an entity state.
- The reading part does not change the state and returns it for a requested query type. State representations for distinct queries are stored in views, which are recalculated asynchronously after update events are received as commands.
The way in which the CQRS pattern works is as follows:

Diagram 7.10 A CQRS implementation for the Order service. The write ...