Open mjaric opened 2 years ago
It's not a very small possibility
actually. I ran into this issue while migrating events from one database to another.
Happened randomly, so it took a painful while to figure out how it was possible for the order to get mixed up.
@mjaric did you find a way around this?
@mjaric did you find a way around this?
I created my persistence plugin. But I can create PR. Tho in such case I have to update all plugins in this repository 😅 before it ends in nuget.
One more thing. Since, comparing to akka.net, proto.actor actually do not require from you to create system actor that extends this framework in order to add eventsourcing. I think you can create your abstract repository and go that route, one aggregate root, one repository.... I like this because everything becomes much simpler to test where in akka you are tight coupled to test kit and your BDD test case start to look like integration test... but that's just opinion.
Currently
Proto.Persistenece.IEventStore
only supports persisting single event at the tame.This may not be good option for some cases. For instance, (and this just my preference) if we are using journal db like EventStore, the client will create ACID until that single event is persisted in EventStore regardless there are other events in batch that should belong to that same ACID transaction.
As a consequence to above case, some other instance could host same persistent actor and write another event. There is very small possibility that this may occur, but again, may produce later false state in Aggregate due unintended event ordering.
I would like to extend IEventStore interface with another function with following signature
This would help utilize EventStore ACID transactions on steam while appending batch of events to it, plus, prevent incidental appends from other "sources" until transaction completes.
I'm open to create PR. Let me know if you are OK with this suggestion.
Thank you