← Graph

Entity Projection

concept 3 connections

In event sourcing, projecting an entity means reading its stream sequentially starting from a blank/empty data structure, traversing each event one by one and updating the in-memory representation accordingly (e.g. copy attributes on 'opened', add balance on 'deposited', subtract on 'withdrawn'). Projecting into a materialized view / read-model database works the same way as projecting into an in-memory entity. Handlers should control the projection directly rather than receive an already-projected entity, so that caching and snapshotting strategies can be chosen per case.

category
pattern
about
Entity Projection concept
Explains projection as folding an event stream into an entity, and warns against hiding it.
about
Entity Projection concept
Shows projection code folding events into an Account entity from empty state.
related_to
Entity Projection concept
Asked to disambiguate 'entity' as used throughout the talk.

Provenance

Read by
8 extractions