Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregate events streaming #160

Merged
merged 18 commits into from
Sep 15, 2022
Merged

Aggregate events streaming #160

merged 18 commits into from
Sep 15, 2022

Conversation

woksin
Copy link
Contributor

@woksin woksin commented Sep 7, 2022

Summary

Adds a new method to the EventStore for fetching committed aggregate events filtered by event types. This allows us to change the rehydration of aggregates to be much more effective by just fetching the committed aggregate events for an aggregate that are relevant to the rehydration (meaning that there are an On method for that event type). This can have a significant impact on the performance of aggregates that have many events, but few state changes or are completely stateless.

Added

  • FetchForAggregate that takes in a list event types used for filtering
  • FetchStreamForAggregate fetches a stream of committed aggregate event batches

Changed

  • Rehydration logic of aggregate roots. It now only fetches the committed aggregate events that are relevant
  • AggregateRootVersion on the CommittedAggregateEvents now represents the current aggregate root version of the aggregate root, not the version of the last committed aggregate event
  • Minor version of Contracts meaning that this version of the SDK is only compatible with version >= 8.5.0 of the Runtime

Fixed

  • Some users could experience exceptions when performing actions on aggregate roots that had lots of events or big events due to the protobuf messages being too big. This should be fixed now since the internals of fetching aggregate roots are now implemented using streaming and batching.

@woksin woksin marked this pull request as draft September 8, 2022 07:20
@woksin
Copy link
Contributor Author

woksin commented Sep 8, 2022

@jakhog Brought up a performance improvement that I@m gonna implement :)

@woksin woksin marked this pull request as ready for review September 8, 2022 10:00
@woksin woksin merged commit 66d6c77 into master Sep 15, 2022
@woksin woksin deleted the aggregate-events-streaming branch September 15, 2022 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants