CQRS and Event Sourcing Intro for Developers

CQRS and Event Sourcing Intro for Developers

Adding such tables instead of database views removes the burden of writing complex queries and opens new possibilities for scaling your solution, but it requires that you somehow keep your domain command model “in-sync” with your query model tables. In this approach we use different storage engines for queries models and for command models, for example:

Each command handler should emit event with information what happened. These event handlers perform CRUD operation upon the persistent read model (Java example, C# example).

Source: altkomsoftware.pl