MySQL adapter
domainflow/event-sourcing-mysql implements the Event Sourcing Core storage
contracts using PDO and MySQL. It translates Core events, snapshots,
process-manager state, and outbox entries to SQL tables and does not contain
domain modeling.
Components
| Component | Responsibility |
|---|---|
MySqlEventStorage | Event streams, global reads, transactions, concurrency, and optional outbox enrollment |
MySqlSnapshotStorage | Latest snapshot per aggregate |
MySqlSnapshotHistoryStorage | Versioned snapshot history |
MySqlProcessManagerStorage | Versioned process-manager state and timeout lookup |
MySqlOutboxStorage | Claimable outbox entries and abandoned entries |
MySqlSchemaManager | Runs the shipped SQL schema files |
Requirements
- PHP 8.4+
ext-pdo- MySQL 8+ reachable by the application
- InnoDB tables; the adapter's atomicity guarantee relies on transactions
Installation
composer require domainflow/event-sourcing-mysql
Documentation
- Installation and schema setup
- MySQL configuration and transactions
- Operations, custom fields, and testing
See the Core documentation for aggregate modeling and the storage contracts implemented here.