CQRS and event-driven architecture are not the same thing
Today’s topic is architectural patterns in high-load systems. I often hear people link CQRS and Event-Driven Architecture, or even treat them as the same thing. In fact, the connection between them is rather weak.
CQRS is about separating the flows of write and read requests, with a focus on optimising each of them. To implement CQRS you don’t need Event-Driven Architecture, or a message or event broker at all. Such an implementation is possible, though, and it helps separate the writing and reading components as far as possible, while bringing a new pain in the form of eventual consistency.
You can read about different ways to implement CQRS in this article.
Event-Driven Architecture (EDA), in turn, is an architectural approach to building adaptive, resilient and scalable distributed systems by reducing the coupling between components. At its core is generating events about changes in the system’s state and building business processes as reactions to those events. Within EDA there are plenty of ready-made design patterns for different cases.
And, even more importantly, both CQRS and EDA can be used outside a microservice architecture too. :)