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

Remove unnecessary consistency validation from MongoDB event store #180

Open
bounoable opened this issue Dec 11, 2023 · 0 comments
Open

Comments

@bounoable
Copy link
Contributor

bounoable commented Dec 11, 2023

#178 made me realize that the MongoDB event store already creates a unique index for "aggregateName" + "aggregateId" + "aggregateVersion". So I'm not sure why I implemented the consistency check using a separate state collection. The index should already ensure optimistic concurrency for aggregates, so I think the additional check can be removed.

Note: The event store must still return a VersionError if the insertion fails because of the index violation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant