eventhus icon indicating copy to clipboard operation
eventhus copied to clipboard

MongoDB Eventstore has a 16MB limit of per aggregate root

Open lucaswxp opened this issue 5 years ago • 1 comments

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 avatar May 15 '20 22:05 lucaswxp

@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?

ccamel avatar Jun 09 '20 16:06 ccamel