EventStoreDB
By Event Store Ltd.
EventStoreDB is an open-source database purpose-built for the event sourcing architectural pattern, storing data as an immutable, ordered sequence of events rather than mutable rows, so that an application's current state can always be…
Definition
EventStoreDB is an open-source database purpose-built for the event sourcing architectural pattern, storing data as an immutable, ordered sequence of events rather than mutable rows, so that an application's current state can always be derived by replaying its full history of events. It provides native support for streams, projections, and subscriptions, letting applications both append new events and rebuild or react to state changes derived from the event log.
Overview
EventStoreDB exists because implementing event sourcing on top of a general-purpose relational or document database is awkward: developers end up hand-rolling append-only tables, optimistic concurrency checks, and projection mechanisms that a database designed around the pattern already provides natively. Event sourcing itself models application state not as a single mutable record updated in place but as the sequence of events that led to the current state — a bank account balance, for example, is derived by replaying every deposit and withdrawal event rather than being stored as a single number that gets overwritten. EventStoreDB gives that model a dedicated storage engine rather than treating it as an application-level pattern bolted onto a generic database. Mechanically, EventStoreDB organizes events into streams, each an ordered, append-only sequence of immutable events identified by a stream name and a monotonically increasing position. Writes support optimistic concurrency control using expected version numbers, so two writers competing to append to the same stream can detect and resolve conflicts safely. The database supports projections, a mechanism for deriving new streams or aggregated views from existing event streams using JavaScript-based functions, and subscriptions, which let consumer applications receive new events in near real time as they are appended, either from a specific stream or across the whole event log. Clustering support provides replication and high availability across nodes. Within the broader data storage landscape, EventStoreDB is a specialized alternative to using a relational database with manually implemented event tables, and it differs from general-purpose streaming systems like Apache Kafka in that EventStoreDB is built around durable, queryable, per-entity event streams with strong ordering guarantees and built-in projections, while Kafka is built around high-throughput, partitioned topics primarily intended for pub-sub distribution rather than long-term canonical storage of entity state. Some architectures use both together, with EventStoreDB as the system of record for event-sourced aggregates and Kafka distributing derived events to other services. In practice, EventStoreDB is adopted by teams implementing domain-driven design with event sourcing and CQRS (command query responsibility segregation), commonly in financial systems, e-commerce order processing, and other domains where a full audit trail of every state change is valuable, not just the current state. Its projections and subscriptions are used to build read-optimized views separate from the write-side event streams, supporting the CQRS pattern directly. The trade-offs are specialization and learning curve. Event sourcing as a pattern requires a different mental model than typical CRUD development, and adopting EventStoreDB commits a team to that model for the streams it manages. Teams without a strong reason to model state as an event history — most CRUD applications — get little benefit from EventStoreDB over a conventional database, and even teams doing event sourcing sometimes implement it on top of a general-purpose database or Kafka instead of adopting a dedicated event store.
Key Features
- Stores data as immutable, ordered, append-only event streams
- Optimistic concurrency control via expected stream version numbers
- Projections derive new streams and views using JavaScript functions
- Subscriptions deliver new events in near real time to consumers
- Built specifically to support event sourcing and CQRS patterns
- Clustering for replication and high availability across nodes
- Full, queryable audit trail of every state-changing event
- Distinct from Kafka in prioritizing per-entity ordered storage