Definition
Optimistic concurrency control allows an actor to read state and propose a change, but accepts the write only if the relevant state still matches the version that was read. The version comparison and write must be atomic. This protects against overwriting a newer decision using stale evidence; it is distinct from deduplicating retries of one operation.
Why It Matters
- Two agents can make different, individually reasonable changes to the same order while working from the same old state.
- A customer-service operator may edit an order between an agent reading it and submitting an action.
- A Commerce Intelligence OS needs to retain the connection between the state evaluated and the state actually changed.
How It Works
- Read the resource with a version token and record the proposed change against that version.
- Submit the write with an atomic expected-version condition at the authoritative service. Increment or replace the version when the write succeeds.
- On conflict, read current state and reassess business rules and authorization. Do not simply replace the token and replay a now-inappropriate decision.
- Bound retries and escalate repeated conflicts. Use transaction or workflow controls where an invariant spans several resources; one record version does not protect an entire distributed process.
Ecommerce Example
Context: Illustrative example: two workers read order version 7. One changes the delivery address and commits version 8; the other tries to save a gift message using its old full-order snapshot.
Recommended move: Reject the second write because version 7 is stale. Reload version 8 and evaluate a narrow gift-message update that preserves the new address.
Why it matters: The intended result avoids a lost address update. This hypothetical workflow is separate from checking whether a previous request already executed.
iKawn Framework
Read
The iKawn framework captures the version behind an agent decision.
Condition
Bind the proposed mutation to an authoritative state check.
Reassess
Treat a conflict as changed evidence requiring a fresh decision.
Audit
Record accepted versions, rejected writes, and escalations.
Concise Summary
Bind agent writes to the state they evaluated. An atomic version check prevents stale overwrites; conflict handling must reconsider the decision as well as retry the transport.