Software Engineering Flashcard
How does optimistic concurrency control work?
Concepts
Deckcollaboration Tags
Question
How does optimistic concurrency control work?
Answer
No lock is held between read and write. The client reads a version token (ETag, SHA, version number), modifies locally, then writes back with the token. The server rejects the write if the token changed (409 Conflict / 412 Precondition Failed). Same as Compare-and-Swap (CAS) at the application level.