Browse patterns / Service architecture / B022
event sourcing

Event sourcing

Event sourcing records every change to application state as a sequence of events so that past states can be reconstructed.

Recorded evidence 13/14Compare →Source
01 / UNDERSTAND

Structure and behavior

Follow the arrows step by step.

Record state changes as events and replay them. Account for event versioning and replay cost.

Expected benefits

Can improve auditability and write performance in complex systems.

Trade-offs

Introduces substantial complexity and trade-offs in data storage, concurrency, schema evolution, and querying.

Event sourcing is hard to justify for simple CRUD systems that mainly query current state and place little value on change history.

02 / APPLY

Operations and adoption guide

Synthesis, distinct from items backed by source excerpts. Validate before applying in production.

When to use

Suitable for domains such as order processing, customer onboarding, contract negotiation, and multi-step approval, where change history and decision-making matter. Typical uses are financial and commerce systems that require audits, regulatory compliance, or reconstruction of earlier states.

Scenario

A mid-sized commerce company rebuilds an order system that handles millions of orders, including order, payment, and delivery status. Requirements include an immutable audit log of all state changes, point-in-time reconstruction, rebuilding the read model after failure, and maintaining peak-time write throughput. Store one append-only event stream per order, use snapshots and asynchronous projections for the query model, and isolate poison events in a DLQ.

Placement principles

  • Deploy the event store on a stateful cluster with persistent volumes (PVCs)
  • Separate the projection and read model into dedicated services and databases
  • Keep snapshots and checkpoints in durable storage so processing can restart
  • Place the outbox and message broker alongside the domain DB to support atomic publication
  • Keep monitoring, the DLQ, and the schema registry in the operations layer.

On premises

On premises, operate the stateful event-store cluster, persistent storage, backups and recovery, and security and secrets management yourself, and standardize them using declarative deployment tools.

03 / VERIFY

Evidence by criterion (14 total)

Evidence availability at the time of research. Assess source accuracy and currency separately.

Definition and overviewEvidence available

Event sourcing records every change to application state as a sequence of events so that past states can be reconstructed.

Event Sourcing ensures that all changes to application state are stored as a sequence of events.

martinfowler.com original ↗

Problem addressedEvidence available

Instead of storing only current state, keep the complete sequence of actions on an object in an append-only store to improve auditability and write performance.

store the full series of actions taken on an object in an append-only store.

learn.microsoft.com original ↗

Key components and resourcesEvidence available

Key components include an event store, a message broker, a stateful cluster with persistent volumes (PVCs), and operational resources such as secrets and configuration.

configuration uses a PersistentVolumeClaim for durable storage and passes secrets and configuration via arguments

www.eventfoundation.io original ↗

Data and asset placementEvidence available

Append events in order as immutable records that cannot be modified or deleted; use snapshots and durable storage to speed up replay.

New events must be added at the end of the sequence. - Immutability. Previous events cannot be updated.

developer.ibm.com original ↗

Typical use casesEvidence available

Suitable for customer onboarding, order processing, contract negotiation, and multi-step approvals where the history of changes and decisions matters.

customer onboarding, order fulfillment, contract negotiation, or multi-step approvals

www.eventfoundation.io original ↗

Example scenarioEvidence available

One example is a Dutch software vendor offering an event-sourcing and CQRS platform to enterprise Java teams.

Company: a software vendor in the Netherlands, selling an event-sourcing and CQRS platform to enterprise Java teams.

cloudtech.engineering original ↗

When to avoid and caveatsEvidence available

Event sourcing is hard to justify for simple CRUD systems that mainly query current state and place little value on change history.

For more simple cases where the focus is more on the current state of the application than on histories of changes

www.confluent.io original ↗

On premises: development, deployment, and operationsEvidence available

On premises, manage an event-streaming platform on privately operated infrastructure using deployment and operations tooling based on declarative APIs.

self-managing their private infrastructure in on-premises environments

www.confluent.io original ↗

Cloud: development, deployment, and operationsEvidence available

Cloud setups include Kubernetes and integrated CI/CD and monitoring on multicloud infrastructure such as GCP and AWS.

Clouds: Google Cloud as the primary platform, AWS alongside it.

cloudtech.engineering original ↗

Kubernetes: development, deployment, and operationsEvidence available

On Kubernetes, deploy a stateful event store with production-ready persistent volumes, secrets, and configuration.

This guide shows how to run EventSourcingDB in a Kubernetes cluster using a production-ready configuration.

www.eventfoundation.io original ↗

Incident responseEvidence available

A poison event that fails on every retry can block the stream and read model at the head of the line; use a DLQ, isolation, and rebuild procedures.

Without a release valve, that one event blocks the stream forever and the read model freezes at that point (head-of-line blocking).

relay.nuvoralabs.com original ↗

BenefitsEvidence available

Can improve auditability and write performance in complex systems.

This approach can improve auditability and write performance in complex systems.

learn.microsoft.com original ↗

Drawbacks and trade-offsEvidence available

Introduces substantial complexity and trade-offs in data storage, concurrency, schema evolution, and querying.

Event sourcing is a complex pattern that introduces significant trade-offs.

learn.microsoft.com original ↗

Representative tools and technologiesUnverified

No primary-source evidence was recorded. This does not imply that the pattern is unsuitable.

Additional references (23)