Skip to main content

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​

ComponentResponsibility
MySqlEventStorageEvent streams, global reads, transactions, concurrency, and optional outbox enrollment
MySqlSnapshotStorageLatest snapshot per aggregate
MySqlSnapshotHistoryStorageVersioned snapshot history
MySqlProcessManagerStorageVersioned process-manager state and timeout lookup
MySqlOutboxStorageClaimable outbox entries and abandoned entries
MySqlSchemaManagerRuns 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​

See the Core documentation for aggregate modeling and the storage contracts implemented here.