AlgoViz

CQRS

medium 30 min

CQRS means Command Query Responsibility Segregation.

Where it shows up

The same pattern appears across everyday software.

  • AWS guidance

    AWS describes the pattern with a DynamoDB write side and a relational read side, and warns that it typically results in eventual consistency.

  • Microsoft Azure guidance

    The Azure architecture center describes one or two stores, materialized views in the read store, and the extra complexity when combined with event sourcing.

  • Elasticsearch as a read model

    A search index is filled from a main database. By default it refreshes every second on indices that were searched in the last 30 seconds, so it is near real time.

  • PostgreSQL materialized views

    A small step towards a read model inside one database. The data is as of the last REFRESH, so it is not always current.

  • Axon Framework

    A Java framework with command and query messages. Its subscription queries give an initial answer and then updates.

  • KurrentDB

    An event store with a projections subsystem that reacts to appended events.