EventFlow icon indicating copy to clipboard operation
EventFlow copied to clipboard

Event segregation by aggregate type

Open Reyhn3 opened this issue 4 years ago • 2 comments

This PR addresses the issue that IIdentity is not fully honored by IEventPersistence, as reported in #820.

Without this fix, it is not possible to implement your own IIdentity because identities of different aggregate types risk colliding. The changes in this PR are related to adding aggregate type info to event stores, so that they may store events from different aggregate types smarter.

Breaking changes

The EventStoreEventPersistence for Event Store has had the stream names prefixed with the aggregate type. That will make this code unable to find any existing streams.

Caution advised

The SQL-based event persistence libraries already stored the aggregate type (name). The loading of events have been updated to include the aggregate name as a criteria, which may affect performance. The table creation scripts have had the index updated to compensate for this, but current tables may have to be manually reindexed.

This also affects EntityFramework, depending on which database is used.

As for MongoDB, the aggregate name has been added to the index. I am unsure of what impact this may have on existing databases.

Reyhn3 avatar Jan 05 '21 15:01 Reyhn3

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jan 05 '21 15:01 CLAassistant

Codecov Report

Merging #821 (a21f17f) into develop-v0 (b97d0a5) will increase coverage by 0.13%. The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff               @@
##           develop-v0     #821      +/-   ##
==============================================
+ Coverage       78.90%   79.03%   +0.13%     
==============================================
  Files             336      336              
  Lines            8470     8514      +44     
  Branches          833      833              
==============================================
+ Hits             6683     6729      +46     
+ Misses           1466     1464       -2     
  Partials          321      321              
Impacted Files Coverage Δ
Source/EventFlow/Extensions/TypeExtensions.cs 96.92% <ø> (ø)
...ork/EventStores/EntityFrameworkEventPersistence.cs 91.35% <100.00%> (+0.21%) :arrow_up:
...tityFramework/Extensions/ModelBuilderExtensions.cs 100.00% <100.00%> (ø)
...entStores.EventStore/EventStoreEventPersistence.cs 90.29% <100.00%> (+0.81%) :arrow_up:
...Flow.MongoDB/EventStore/MongoDbEventPersistence.cs 88.33% <100.00%> (+1.29%) :arrow_up:
...B/EventStore/MongoDbEventPersistenceInitializer.cs 100.00% <100.00%> (ø)
...entFlow.MsSql/EventStores/MsSqlEventPersistence.cs 91.08% <100.00%> (+0.46%) :arrow_up:
Source/EventFlow.MsSql/MsSqlConnection.cs 100.00% <100.00%> (ø)
...tgreSql/EventStores/PostgresSqlEventPersistence.cs 90.81% <100.00%> (+0.49%) :arrow_up:
...tFlow.SQLite/EventStores/SQLiteEventPersistence.cs 90.81% <100.00%> (+0.49%) :arrow_up:
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b97d0a5...a21f17f. Read the comment docs.

codecov[bot] avatar Jan 05 '21 16:01 codecov[bot]

Hello there!

We hope this message finds you well. We wanted to let you know that we have noticed that there has been no activity on this pull request for the past 90 days, which makes it a stale pull request.

As a result, we will be closing this pull request within the next seven days. If you still think this pull request is necessary or relevant, please feel free to update it or leave a comment within the next seven days.

Thank you for your contributions and understanding.

Best regards, EventFlow

github-actions[bot] avatar Apr 08 '23 13:04 github-actions[bot]

Hello there! I'm a bot and I wanted to let you know that your pull request has been closed due to inactivity after being marked as stale for seven days. If you believe this was done in error, or if you still plan to work on this pull request, please don't hesitate to reopen it and let us know. We're always happy to review and merge high-quality contributions. Thank you for your interest in our project! Best regards, EventFlow

github-actions[bot] avatar Apr 16 '23 09:04 github-actions[bot]