Read Model Projections
One of the common concerns of the A+ES design approach is how to query the Aggregates by their properties. Event Sourcing does not provide a simple way to answer a question such as “What is the total amount of all customer orders within the last month?” We would actually need to load every Customer instance, enumerate all of the Order instances within the last month for each one, and calculate their total, which would be extremely inefficient.
This is where Read Model Projections can help. Read Model Projections can be realized through a simple set of Domain Event subscribers that are used to generate and update a persistent Read Model. In other words, they project Events to a persistent Read Model. When Event subscribers ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access