Continuous Improvement for Software Engineers

Instructions, notes and guides to help with continuous software improvement.

View on GitHub

Command Query Responsibility Segregation - CQRS

HediMokhtar / CC BY-SA (https://creativecommons.org/licenses/by-sa/4.0)

The pattern was originally described by Greg Young in 2011, but promoted by Martin Folwer via his pattern and practices books. Its used in combination with Domain Driven Design and Event programming. The query side of the equation is designed for speed and often includes readonly sources or memory/cached versions of data that eventually become consistent. The Actor Model, defined in 1973 by Karl Hewitt, was added as the complimentary architecture by Vaughn Vernon.

Messages sent to queues are asynchronous, providing very fast processing of data changes.

Not core features of CQRS

  1. Resiliency - implementation strategy to resolve.
  2. Elastic scaling up and down to meet demand is also part of the implementation strategy.

The pattern is just a guide, the implementation of CQRS is left up to the software engineer. It fits into a micro-services architecture and provides excellent starting points for Service Reliability Engineering.

References

Eventual Consistency Trade-Offs in Distributed Systems

Consistent, Available, Tolerant - CAP Theorem

CQRS Journey

CQRS Evolved with AKKA.net

Event Storming - ‘What happened’

DevOps - Service Reliability Engineering

Akka.net - Actor Model framework

Foundatio - Building Blocks for distributed applications

NServiceBus