patchlevel / event-sourcing

An event sourcing library, complete with all the essential features, powered by the reliable Doctrine ecosystem and focused on developer experience.
https://event-sourcing.patchlevel.io
MIT License
139 stars 5 forks source link

Open event store for non-aggregate events #535

Closed DavidBadura closed 3 months ago

DavidBadura commented 8 months ago

Currently the event store can only be used with aggregates. This limits the use of the subscription system. A hybrid approach of d event sourcing and doctrine orm with domain events is also made more difficult.

Maybe we can generalize the store a bit so that we can also store non-aggregate events.

The following needs to be solved:

1) We don't have aggregate_name and aggregate_id. But we could probably solve it very easily by combining the fields in "stream", which is basically structured like this: "{aggregate_name}-{aggregate_id}". Then other systems could name their own stream such as: “doctrine” or “external”.

2) We also have to make playhead optional because it doesn't always exist. We set the column as "nullable". We have to check if we can do this for all DB platforms regarding the unqiue constraint.

DanielBadura commented 4 months ago

After our talks on the UserGroup @bwaidelich and I talked briefly about this topic and he send me some links to research.

Maybe some interesting information on this topic in these resources: