Skip to content

Remove unnecessary consistency validation from MongoDB event store #180

@bounoable

Description

@bounoable

#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions