Optimistic concurrency
Section titled “Optimistic concurrency”Optimistic concurrency lets actors perform work without holding exclusive ownership, then validates that the state they relied on has not changed before committing.
A common implementation compares a version, timestamp, or expected value in an atomic conditional write.
It works well when conflicts are uncommon. Frequent conflicts can turn validation failures and retries into significant extra work.
Related knowledge
Optimistic concurrency and compare-and-setDetect stale concurrent updates with a version or expected value instead of preventing every conflict before work starts.
Optimistic versus pessimistic concurrency controlDecide whether to detect conflicts at commit time or prevent them by locking first, based on contention and the cost of a retry.