NEventStore Commit Guid, what is it really used for?
Asked Answered
C

1

3

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?

Churchwell answered 20/5, 2013 at 6:55 Comment(2)
Good question; I can answer it (to allow competing writers who have a shared identifier such as a Command Id) to more cheaply induce fail fast idempotency behavior in the Commit process.Inelegance
Thanks Ruben. For those who want to dig into this try here: docs.geteventstore.com/dotnet-api/3.6.0/…Insouciance
I
3

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.

Inelegance answered 20/5, 2013 at 21:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.