Event Sourcing
The event log as the system of record, with state as a projection.
4 to work through
-
advanced
A ledger service rebuilds its balance projection from the event log into a new store. The rebuilt balances differ from the live ones for about 0.3% of accounts, all of them accounts with activity during two specific weeks last year. The event log has not been modified. What went wrong, and which design decision allowed it?
3 min answer -
advanced
A platform considers event sourcing for auditability. What is the permanent cost teams underestimate, and what is the cheaper alternative?
2 min answer -
advanced
A team proposes event sourcing for a customer preferences service. What questions do you ask?
2 min answer -
advanced
Design the data model for recording money movement in a marketplace. What properties are non-negotiable?
2 min answer
3 terms in this topic
Event Sourcing in Practice
Storing the sequence of changes rather than current state, the capabilities that follow, and the erasure problem that must be designed for on day one.
patternEvent Stream Versioning
Transforming an old event version into the current shape when it is read, allowing a stored event history to be interpreted by evolved code.
conceptReplay Determinism
The property that folding an event log through a projection handler yields the same state every time it is run, which is what makes an event log rebu…
Neighbouring topics
Architecture Patterns
General material on architectural patterns and their trade-offs.
Layered Architecture
The default shape, its clarity, and where a technical partition fails.
Event-Driven Architecture
Publishing facts, and trading comprehensibility for decoupling.
Pipes and Filters
Independent transformation steps composed into a pipeline.
Publish/Subscribe
Broadcast to every subscriber, as distinct from work distribution.
Competing Consumers
Scaling throughput with instances, at the cost of ordering.
Saga
Local transactions with compensating actions across services.
CQRS
Separate models for writing and reading, each optimised for its job.
Outbox
Making the event atomic with the business write it describes.
Strangler Fig
Incremental replacement behind a routing facade.
Anti-Corruption Layer
Translating a foreign model at the boundary so it does not leak in.
Sidecar & Ambassador
Cross-cutting behaviour in a co-deployed process.
Service Mesh
Sidecars applied estate-wide, and the scale at which that pays.
API Gateway
A single entry point for policy, routing and protocol translation.
Backend for Frontend
A narrow backend per client experience, owned by that client's team.
Cell-Based Architecture
Complete isolated copies each serving a subset of customers.
Sharding Patterns
Directory versus embedded keys, logical shards and rebalancing.
Materialized Views
Precomputed query results, refreshed incrementally or in full.
Orchestration vs Choreography
A coordinator that knows the flow, or services that react to events.