Readmodel, listview #2032
-
Hi there, I 'm a beginner when it comes to event sourcing.. Hope this is the right area where to ask... When I would want to give the user a simple listview of all aggregates of a certain type (lets say a list of all Invoices), what are common patterns to do so? I imagine that here I would use some sort of projections to create such a view? Is it correct that I would use a projection that listens for all events that would update the data that is shown in the view, and stores them in some format (i.e. inmemory). Or would I in the case of marten have all aggregates persisted with martens document store capability when updating an aggregate root? Im asking for some practical solutions here. What are you people doing, for some sort of simple invoicing tool for example... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
To answer my own question: A practical option seems to be to use an aggregate with an inline projection. If I am not mistaken this will result in a table per aggregate type with rows representing a single aggregate. This table can then be queried easily |
Beta Was this translation helpful? Give feedback.
-
@jannikbuschke Inline projections are fine if you don't have too many concurrent operations affecting the same aggregate (given your scenario of simple invoice generation scenario, you should be fine). Otherwise you may have to look at using Async Projections Daemon |
Beta Was this translation helpful? Give feedback.
@jannikbuschke Inline projections are fine if you don't have too many concurrent operations affecting the same aggregate (given your scenario of simple invoice generation scenario, you should be fine). Otherwise you may have to look at using Async Projections Daemon