The-Inevitable-Event-Centric-Book
The-Inevitable-Event-Centric-Book copied to clipboard
Problem: Define the word Projection
In the context of event sourcing
A projection is a function that can be applied to an ordered set of events to produce some aspect of the state resultant from those events.
For each event in the set it needs to decide: (1) Do I care about this event (usually do I care about this type of event) (2) If so, what do i do as a result of it
Suggestions: Mention CQRS and the fact that a projection is often a denormalised, read model tailored for performant reads.
A projection flattens time out into space, "pooling" information into data structures.
Also worth remembering the original metaphor:
My preference is to call anything that reacts to a (domain)event as a "reactor". Reactors that project are only a subset of all reactor types.