commanded/eventstore
68.5
Adequate · 9 November 2026
6.6k
lines of production code
Elixir
primary language
10
measurements over time
What this system is
This system is an Elixir library that implements an event store backed by PostgreSQL, enabling applications to persist and retrieve events within named streams. It provides core capabilities for appending and reading events, managing stream lifecycles with optimistic concurrency control, and handling persistent subscriptions with real-time notifications via PostgreSQL LISTEN/NOTIFY. The library also supports snapshotting, cluster configuration, and comprehensive database schema management through Mix tasks and migrations.
How it got here
2016 — Initial release and core feature implementation
18 changes.
This period marks the initial release of the EventStore library for Elixir, establishing the foundational architecture for PostgreSQL-based event persistence. The work focused on implementing core capabilities such as stream management, subscription handling with advisory locks, and snapshot support, alongside comprehensive test coverage and performance benchmarking.
2017–2020 — Event Store architecture and tooling
11 changes.
This period focused on establishing the core Event Store infrastructure, including schema migrations, cluster node configuration, and runtime instance management. Significant work involved replacing polling with PostgreSQL LISTEN/NOTIFY for real-time event notifications and extracting SQL queries into EEX templates for better maintainability. The era also introduced comprehensive CLI tasks for database lifecycle management and robust test coverage for subscriptions and notification resilience.
Features
Added SQL scripts for querying and managing event store data
New SQL scripts have been added to the scripts directory to facilitate querying and managing the event store. The all\_events.sql script retrieves the latest 10 events from the $all stream, including event details and encoded data. The snapshots.sql script queries snapshot data ordered by creation time. The subscriptions.sql script lists subscription names, their last seen positions, and the number of pending events. Additionally, the truncate.sql script provides a way to clear all data from the core tables (snapshots, subscriptions, stream\_events, streams, events) and re-initialize the $all stream.
scripts · high confidence
Added benchmarking seed script for event store
A new Elixir script (bench/seed\_eventstore.exs) has been added to populate the event store with 1 million events (100 per stream) for benchmarking purposes. This script initializes the test event store and uses the EventFactory and UUID utilities to generate and append the events, providing a standardized dataset for performance testing.
bench · high confidence
Added cluster node configuration files
Added configuration files for three cluster nodes (node1, node2, node3) that define optional synchronization partners and a 30-second timeout, enabling the system to form a cluster where each node can optionally sync with the others.
cluster · high confidence
Initial release of EventStore for Elixir
This entry introduces the EventStore library, an Elixir-based event store that uses PostgreSQL as its underlying storage engine. The release includes the core library code, configuration files (such as \.formatter.exs\ and \.tool-versions\ specifying Elixir 1.20.4 and Erlang 29.1.1), and comprehensive documentation in the README and guides. Key capabilities documented include appending and reading events from streams, subscribing to streams (both transient and persistent), and managing subscriptions with acknowledgment. The project also provides a \docker-compose.yml\ for local development and a benchmark suite for performance testing.
(repo-wide) · high confidence
Introduce stream management and versioning logic
This change introduces the core logic for managing event streams, including appending events, linking events, reading streams forward and backward, paginating streams, and deleting streams (soft or hard). It adds a \StreamInfo\ struct to track stream metadata like UUID, version, and status, and implements version validation to ensure correct optimistic concurrency control during writes. The implementation supports batch appends, transactional writes for larger batches, and allows overriding the \created\_at\ timestamp.
_lib/event\store/streams · high confidence
New CLI tasks for EventStore lifecycle management
The library now provides dedicated Mix tasks to manage the EventStore database lifecycle. Users can create the database and schema (\create\), drop them (\drop\), initialize the store (\init\), run schema migrations (\migrate\), and check migration status (\migrations\). These tasks support configuration options such as \is\_mix\ for runtime usage outside of Mix and \quiet\ to suppress output, and the migration task includes logic to prevent concurrent execution via a database advisory lock.
_lib/event\store/tasks · high confidence
New Mix tasks for EventStore database management
This change introduces five new Mix tasks (\event\_store.create\, \event\_store.drop\, \event\_store.init\, \event\_store.migrate\, and \event\_store.migrations\) to manage EventStore databases. These tasks allow users to create, drop, initialize, migrate, and check the status of EventStore databases via the command line, supporting configuration via the \:event\_stores\ app config or the \-e\ flag to specify a particular event store. Each task ensures that \:postgrex\ and \:ssl\ applications are started before execution.
lib/mix/tasks · high confidence
New PostgreSQL storage layer for event persistence and subscription management
This change introduces a complete new storage implementation for the Event Store using PostgreSQL. It adds dedicated modules to handle core operations: appending and linking events in batches (Appender), reading events forward and backward (Reader), managing stream lifecycle including creation and deletion (CreateStream, DeleteStream, Stream), and handling subscription tracking with acknowledgment (Subscription). It also includes support for database initialization and schema management (Database, Initializer, Schema), snapshot persistence (Snapshot), and distributed locking via PostgreSQL advisory locks (Lock).
_lib/event\store/storage · high confidence
PostgreSQL event store schema initialization and SQL statement generation
The \lib/event\_store/sql\ module now provides the core infrastructure for initializing and managing the PostgreSQL event store schema. The \Init\ module generates the SQL statements required to create the necessary tables (\streams\, \events\, \stream\_events\, \subscriptions\, \snapshots\, \schema\_migrations\) and associated indexes, triggers, and functions, including configurable column data types for correlation and causation IDs. The \Reset\ module offers a way to truncate these tables and re-seed the \$all\ stream. The \Statements\ module acts as a central dispatcher, using EEx templates to generate specific SQL operations for common event store actions like inserting events, querying streams, managing subscriptions, and handling snapshots.
_lib/event\store/sql · high confidence
Snapshot serialization and deletion capabilities
The snapshot subsystem now supports configurable serialization and the ability to delete snapshots. Snapshot data and metadata are serialized using a provided serializer before storage and deserialized upon retrieval, allowing for flexible data handling. Additionally, a new \delete\_snapshot\ function has been added to the public API, enabling users to remove previously recorded snapshots for a given source.
_lib/event\store/snapshots · high confidence
Behavioural changes
Event Store database schema migrations (v0.9.0–v1.3.2)
This change adds a series of SQL migration scripts for the Event Store's internal database schema, covering versions v0.9.0 through v1.3.2. These migrations define the evolution of the underlying storage structure, including the creation of core tables like \events\, \streams\, and \stream\_events\, the introduction of UUID-based identifiers, and the implementation of immutability constraints via database rules and triggers to prevent unauthorized updates or deletions. Additionally, the scripts establish a PostgreSQL \LISTEN\/\NOTIFY\ mechanism for real-time event pub/sub notifications and manage schema versioning to ensure safe upgrades for existing installations.
priv · high confidence
Extract SQL statements into EEX templates
The SQL queries for the event store have been extracted from inline strings into individual EEX template files (e.g., \insert\_events.sql.eex\, \query\_stream\_events\_forward.sql.eex\). This change introduces schema name quoting for all statements and adds support for reading and streaming events backward, as well as paginating streams. It also includes new logic to calculate stream versions in SQL for \expected\_version: :any\_version\ scenarios and allows overriding \created\_at\ timestamps for copy transform workflows.
_lib/event\store/sql/statements · high confidence
Introduce EventStore macro and Jason JSON serializer
The library now provides an \EventStore\ macro (\use EventStore\) to define event store modules, replacing the previous empty module stub. Additionally, the JSON serialization backend has been switched from Poison to Jason, requiring users to ensure the \Jason\ library is loaded.
lib · high confidence
Introduce PostgreSQL LISTEN/NOTIFY-based event notifications
The event store now uses PostgreSQL's native LISTEN/NOTIFY mechanism for real-time event pub/sub instead of polling. A new notification pipeline (Listener, Publisher, and Supervisor) listens for database notifications, reads the affected event ranges from storage, and broadcasts them to subscribers via PubSub. This change improves notification latency and reduces database load by leveraging a dedicated Postgrex connection for notifications, with support for configurable query timeouts and schema-aware channel names.
_lib/event\store/notifications · high confidence
Introduce advisory locks and monitored server for connection resilience
The event store now uses PostgreSQL advisory locks to coordinate subscriptions and prevent double supervision, ensuring that only one subscription instance holds the lock for a given stream. A new \EventStore.AdvisoryLocks\ module manages these locks, while \EventStore.MonitoredServer\ wraps database connections to automatically restart them on failure using an exponential backoff strategy. This improves resilience when database connections are lost, allowing subscriptions to recover and reacquire locks without manual intervention.
_lib/event\store · high confidence
Migrate to Elixir 1.4 config syntax and add environment-specific configuration files
The application's configuration system has been updated to use the Elixir 1.4+ \import Config\ syntax, replacing the legacy \use Mix.Config\ module in the main \config.exs\ file. This change enables the use of \import\_config\ to dynamically load environment-specific configuration files (such as \dev.exs\, \test.exs\, \bench.exs\, \jsonb.exs\, \migration.exs\, and \text\_ids.exs\). These new files provide tailored settings for different environments, including specific database names, serializer choices (e.g., JSONB vs. JSON), and test timeouts, allowing users to easily configure the EventStore for various deployment scenarios like benchmarking or JSONB storage.
config · high confidence
Refactor subscriptions to use a Finite State Machine and local Registry
The subscription implementation has been restructured to use a Finite State Machine (SubscriptionFsm) for managing the subscription lifecycle (initial, catching\_up, subscribed, max\_capacity) and a local Registry for process discovery instead of distributed mechanisms. This change introduces configurable subscriber buffer sizes to control backpressure, tracks in-flight events to ensure at-least-once delivery guarantees, and supports transient subscriptions that do not persist checkpoint state. Subscribers can now confirm receipt of events by event number or struct, and the system monitors subscriber liveness to automatically terminate subscriptions when all connected subscribers have disconnected.
_lib/event\store/subscriptions · high confidence
Runtime configuration parsing and storage for Event Store instances
The Event Store now parses configuration at runtime and stores instance-specific settings in a dedicated GenServer-backed ETS table. This allows the system to retrieve configuration for all running instances or specific named stores, supporting features like per-field column types (correlation\_id, causation\_id) and connection pool options. The parser handles URL parsing with encoded passwords and query parameters, ensuring that runtime configurations are accurately applied and accessible.
_lib/event\store/config · high confidence
Support for multiple event stores in Mix tasks
The \lib/mix/event\_store.ex\ module has been updated to allow Mix tasks to manage multiple event stores. Command-line arguments can now specify event stores via the \-e\ or \--eventstore\ flags, and if no flag is provided, the system automatically discovers all configured event stores from the application environment across all project applications. This enables users to run tasks against specific or all configured event stores rather than being limited to a single default.
lib/mix · high confidence
Test coverage
Added comprehensive test coverage for EventStore core features; Added comprehensive test suite for persistent subscriptions; Added concurrency benchmarks for event storage operations; Added manual test scripts for long-running subscriptions and event store seeding; Added storage layer tests for event persistence and subscriptions; Added test case for stream subscription behavior; Added test coverage for stream operations and deletion modes; Added test support helpers and fixtures; Added tests for notification system resilience and behavior.
Dependencies
Upgrade to EventStore v1.4.10 with Elixir 1.16 and Postgrex 0.22
The EventStore library has been updated to version 1.4.10, raising the minimum Elixir requirement from 1.2 to 1.16. This release upgrades the core database driver \postgrex\ to version 0.22.4 (with a dependency constraint of \~\> 0.17 in mix.exs) and updates \gen\_stage\ to 1.3.2. Additional dependency updates include \jason\ 1.4.5, \fsm\ 0.3.1, and \dialyxir\ 1.4.8. The project configuration now includes structured documentation groups, dialyzer settings, and test aliases for various environments (jsonb, text\_ids, migration).
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 67 → 69 (+2.0)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 99 → 99 (+0.0)
- Architecture 85 → 86 (+1.5)
- Maturity 57 → 61 (+4.5)
- Readiness 61 → 61 (+0.0)
- Security 97 → 96 (-1.2)
- Performance 85 → 85 (+0.0)
Resolved (1)
- Off-boarding risk: anonymized user #1
New (1)
- Off-boarding risk: anonymized user #1
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
commanded/eventstore was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 9 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 49ba9f971bd8be8b9bd77702f9eab4013d3fbbdd — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-bb0cb800cd0f.