Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gemberphp/example-event-sourcing-dcb
Example project (Proof of Concept) with Event Sourcing in PHP using the Dynamic Consistency Boundary (DCB) pattern.
https://github.com/gemberphp/example-event-sourcing-dcb
cqrs dcb ddd domain-driven-design dynamic-consistency-boundary event-sourcing gember
Last synced: about 2 months ago
JSON representation
Example project (Proof of Concept) with Event Sourcing in PHP using the Dynamic Consistency Boundary (DCB) pattern.
- Host: GitHub
- URL: https://github.com/gemberphp/example-event-sourcing-dcb
- Owner: GemberPHP
- License: mit
- Created: 2024-10-11T12:37:02.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-14T19:05:24.000Z (about 2 months ago)
- Last Synced: 2024-11-14T19:40:51.692Z (about 2 months ago)
- Topics: cqrs, dcb, ddd, domain-driven-design, dynamic-consistency-boundary, event-sourcing, gember
- Language: PHP
- Homepage:
- Size: 313 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Event Sourcing with DCB in PHP
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](https://github.com/GemberPHP/event-sourcing).
## This example project
_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](src/Domain/Course/Course.php), [Student](src/Domain/Student/Student.php)) as well as business decision models (e.g. [ChangeCourseCapacity](src/Domain/Course/ChangeCourseCapacity.php), [SubscribeStudentToCourse](src/Domain/StudentToCourseSubscription/SubscribeStudentToCourse.php), [UnsubscribeStudentFromCourse](src/Domain/StudentToCourseSubscription/UnsubscribeStudentFromCourse.php)).
Inspired by other PHP libraries such as [Broadway](https://github.com/broadway), [EventSauce](https://github.com/EventSaucePHP), [Prooph](https://github.com/prooph) and [Ecotone](https://github.com/ecotoneframework) as well as [Axon Framework](https://github.com/AxonFramework) for Java.
### How to run
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
```