eventhus
eventhus copied to clipboard
MongoDB Eventstore has a 16MB limit of per aggregate root
MongoDB has a 16MB limit per document hard-coded, since eventhus uses a single document to store the events, there's a limitation there.
I would recommend using per-document events, instead of per-document aggregates, and you can still make that atomic by simply removing the if condition here and remove entirely this else statement.
Of course, a change to Client.Load() to do a findAll instead of findOne, and sorting by the version later. What you guys think?
@lucaswxp yes, I see your point but if you remove the condition on version here, you can no longer ensure the consistency of events when there're several services updating the aggregate concurrently.
Currently, the implemented !safe mode makes it possible to use optimistic locking for handling concurrent access for data.
What do you think?