Redis adapter
domainflow/event-sourcing-redis implements the Event Sourcing Core storage
contracts against Redis. It provides event storage, snapshots, snapshot
history, process-manager state, and outbox relay storage without adding domain
rules.
Components
| Component | Responsibility |
|---|---|
RedisEventStorage | Redis Streams for aggregate histories and a sorted-set global index |
RedisSnapshotStorage | Latest snapshot per aggregate |
RedisSnapshotHistoryStorage | Versioned snapshot history |
RedisProcessManagerStorage | Versioned process-manager state and timeout index |
RedisOutboxStorage | Claimable outbox entries and abandoned entries |
RedisSchemaManager | Durability checks and explicit key-namespace teardown |
Requirements
- PHP 8.4+
ext-redis- Redis 7+ reachable by the application
The adapter is designed for one Redis instance or Sentinel-managed failover. Redis Cluster is not supported because the atomic write script touches the global index, sequence keys, and one stream per aggregate in one call.
Installation
composer require domainflow/event-sourcing-redis
Documentation
- Installation and durability checks
- Redis configuration and key model
- Operations, outbox, and testing
See the Core documentation for the aggregate model and the storage contracts this adapter implements.