Skip to main content

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

ComponentResponsibility
RedisEventStorageRedis Streams for aggregate histories and a sorted-set global index
RedisSnapshotStorageLatest snapshot per aggregate
RedisSnapshotHistoryStorageVersioned snapshot history
RedisProcessManagerStorageVersioned process-manager state and timeout index
RedisOutboxStorageClaimable outbox entries and abandoned entries
RedisSchemaManagerDurability 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

See the Core documentation for the aggregate model and the storage contracts this adapter implements.