Event Sourcing: A simple trick to get around read models

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

A practical look at an intermediate approach in event sourcing that avoids read models by embedding search fields directly into events. By storing lookup criteria (like employee ID or workday) on each event row, you can query events without maintaining a separate read model. The post covers advantages (simpler consistency, less storage), disadvantages (limited search, data duplication), and a workaround using a two-step query to avoid repeating all search fields on every event. The technique is particularly valuable for bi-temporal event sourcing where read models are complex to implement.

4m read timeFrom planetgeek.ch
Post cover image
Table of contents
Lookup criteriaExtending Events with search dataAdvantagesDisadvantagesA workaround FOR storing all search fields on every eventConclusions

Sort: