Quantcast
Channel: labs @ Qandidate.com
Viewing all articles
Browse latest Browse all 33

Projecting your event stream

$
0
0

When you are using a CQRS and Event Sourcing architecture you are separating your writes from your reads. You can fire commands that change state but return nothing and you have queries that return a result but don't change state.

So when you need to query some data, you can replay your eventstream and listen to specific events you are interested in. Although this can work for quite a lot of cases, most of the time this is not very efficient and it doesn't scale very well.

One solution to solve that, is to use projections to create a view that you can query against. Those projections are created with a projector. A projector listens to events and creates a read model from it. With this method it is really easy to create multiple read models at the same time. Because of the nature of your event stream, collecting facts that happened in the past, you can also easily create new read models for events that happened a long time ago.

∞ labs @ Qandidate.com Permalink


Viewing all articles
Browse latest Browse all 33

Trending Articles