Command Query Responsibility Separation (CQRS) and Event Sourcing (ES) pattern has been around for more than a decade. However, in recent years, many people are familiarizing themselves with these patterns. Is there any reason like technological advancements or others that has lead to its popularity? Are there any problems existed previously that can not be solved by conventional techniques but now CQRS/ES can solve them? If yes, how is it solved by these patterns?
-
2More than a decade? You don't say! You could argue, as [Greg Young does](https://www.youtube.com/watch?v=LDW0QWie21s&t=1m05s), that "event sourcing started off on clay tablets in Sumeria". – jub0bs Jun 28 '21 at 08:59
2 Answers
CQRS allows us to scale our system independently: we often have to handle way more reads than writes hence a different scalability. Why? And All The Things To Consider

- 15
- 2
Are there any problems existed previously that can not be solved by conventional techniques but now CQRS/ES can solve them?
One - when you use persistent data structures, you retain the ability to inspect prior states. In effect, you get fine grained temporal query support.
Depending on your domain, persistent data structures may be a better fit for your domain than mutating data structures, so you might also get lower technical debt.
You also might get better messaging between your services - rather than having a persistence representation and a message representation, you might be able to use "domain events" for both.

- 52,766
- 5
- 49
- 91