Example project (Proof of Concept) with Event Sourcing in PHP using the 'Dynamic Consistency Boundary' (DCB) pattern.
More about the library and the DCB pattern, see Gember Event Sourcing.
The DCB pattern is an interesting concept, but this does not advocate to remove aggregates completely. Instead, a hybrid solution with aggregates and business decision models is probably more likely, depending on your domain.
This example project is using a fictive domain (taken from Sara Pellegrini's blog) where students can subscribe to courses (of any kind). Deliberately this is all what is defined for this domain, to focus on how this could be implemented when using Event Sourcing with the DCB pattern in mind.
It contains both classic aggregates (e.g. Course, Student) as well as business decision models (e.g. ChangeCourseCapacity, SubscribeStudentToCourse, UnsubscribeStudentFromCourse).
Inspired by other PHP libraries such as Broadway, EventSauce, Prooph and Ecotone as well as Axon Framework for Java.
Run database with Docker compose:
docker compose up
Run migrations:
bin/console doctrine:migrations:migrate
You're all set, see what commands you can run:
bin/console gember
Or run the demo command to run random sets of commands automatically:
bin/console gember:demo