A practical introduction to event sourcing, focusing on a minimal implementation that works well for many real-world use cases. Covers core concepts like event ordering by timestamp, lifetime tracking metadata, querying limitations, and performance considerations. Includes production F# code showing expense tracking with discriminated unions, functional projections, and lifetime state types (Existing, Deleted, NeverExisted). The author explains trade-off decisions made for their system, including database-agnostic event ordering and bi-temporal support, while acknowledging when this simple approach falls short.
Table of contents
Event Sourcing IntroductionAbout the order of eventsLifetime InformationQuerying limitationsBut the performance!ConclusionsAn example in F# – for the ones who like a deep diveSort: