CQRS / ES - Meeting, 2016-10-07

CQRS / ES: Meeting, 2016-10-07

Participants: Alexander, Bastian, Dominique, Robert


The big merge

The packages Neos.EventStore, and Neos.EventStore.DatabaseStorageAdapter (Neos.EventStore.InMemoryStorageAdapteris obsolete) were merged into Neos.Cqrs for now to ease development:

NOTE: Please use https://github.com/neos/Neos.Cqrs/issues exclusively for issues and don’t push new commits to the other repositories for now.

Event serialization

Currently the event serialization is broken:
Apart from a a fatal error due to a recent PR the current serializers don’t support nested objects.
The main issue with that: Events will be processed without error but won’t contain the complete payload

@bwaidelich: We should serialize/unserialize events everytime when publishing so that this result is always the same during event handling and replay

Projection replay

No code yet due to short & busy week.

Some implementation ideas though:

  • central authority for projections (aka ProjectionManager) that must be used for all interactions with projections (handle events, replay, flush, …)
  • The ProjectionManager can track usage like last user/date/id of replays etc

@robert shared his concerns that this data might get out of sync if it’s not stored via the same mechanism as the projection’s state.

Suggestion:

We go for a simple approach for now that works along those lines:

The ProjectionManager

  • …takes care of fetching relevant events from the EventStore
  • …passes those to the respective handlers of the projector
  • …stores the last processed event number (aka sequence, version) after it has been handled successfully
  • …will only load events with a minimumVersion greater than the last stored pointer
  • …has a way to reset this pointer

If we come across issues with that approach we could add a new interface that lets the projector take care of the version tracking instead.

@dfeyer: We also might need to implement some locking mechanism in order to prevent race conditions.

1 Like