The Event Sourcing Orkestra component provides utilities and classes for implementing Event Sourcing in a system Using PHP.
It can be seen as persistence agnostic library that serves as an abstraction over the concept of an Event Store. It also provides utilities for modeling Event Sourced Aggregate Roots in a DDD sense, as well as schema validation and migration tools through an upcasting pipeline. It also supports snapshotting and projections.
Note: Being an abstraction library, this component does not provide any concrete implementation of an Event Store (except for an in memory one used for testing), it simply provides the required interface to support the concepts. For an actual implementation this component can be used in tandem with the official companion component
morebec/orkestra-postgresql-eventstore
.You are however, free to implement your own concrete storage implementation according to your system's technology stack. In that case you can refer yourself to the PostgreSQL implementation.
- Event schema migrations through Upcasting
- Modeling classes for Event Sourced Aggregate Roots
- Projections support
- Snapshotting
Create an issue or a discussion on the Orkestra Repository, we will be glad to help you as best as we can!
Install the component in your project through composer.
composer require morebec/orkestra-event-sourcing
For usage read the documentation
Reading from a stream is also very simple: