NEventStore Commit Guid, what is it really used for?

515 views Asked by At

I understand the CommitId is used internally by Jonathan Oliver's event store. So far I've always provided a Guid.NewGuid() for the CommitId.

When would you every want to do anything different?

I don't understand why it is exposed within his common domain Repository.

Can anyone can shed some light on this?

1

There are 1 answers

0
Ruben Bartelink On BEST ANSWER

In general, CommonDomain doesn't try to force a one-size-fits-all opinionated structure.

One way to leverage it is by having writers use their unique incoming Command Id as a CommitId - this means that competing (or retries competing with runs that have yet to time out) will get rejected with a specific exception without needing to enter into/consider/manage Conflict Resolution logic. This is used to fulfil the key tenet of Idempotent Commands.