Installation and First Steps
Installation
And go to DBAL Support in order to configure the connection.
To get started quickly you may find Demo Project useful.
Ecotone Event Sourcing is based on well known and stable Prooph's Event Store. It does provide support for three databases: - PostgreSQL - MySQL - MariaDB
Storing Events in streams using Aggregates
There are two ways, we can make use of Event Sourced Aggregates.
Pure Event Sourced Aggregate
This way of handling events does allow for pure functions. Writes are clearly separated from writes.
EventSourcingAggregate
andIdentifier
works exactly the same as State-Stored Aggregate.Event Sourced Aggregate must provide version. You may leave it to
Ecotone
usingWithAggregateVersioning
or you can implement it yourself.CommandHandler
for event sourcing returns events generated by specific method. This will be passed to theRepository
to be stored.EventSourcingHandler
is method responsible for reconstructingAggregate
from previously created events. At least one event need to be handled in order to provideIdentifier
.
Internal Recorder Aggregate
This way of handling events allow for similarity with State Stored Aggregates.
In order to make use of alternative way of handling events, we need to set attribute to true
EventSourcingAggregate(true)
Command Handlers instead of returning events are acting the same as State Stored Aggregates. All events which will be published using
recordThat
will be passed to theRepository
to be stored.
Handling Event Sourced Saga
Just like Aggregates can be stored in form of events using Event Sourcing Aggregates, the same is for Sagas.
Last updated