Optimistic Concurrency
Problem
Alice and Bob both open the same document.
Alice saves.
Bob then saves his old copy and silently overwrites Alice's changes.
Solution — Version Check
Update only if the data still has the version you originally read.
Read version 7
↓
UPDATE ... WHERE version = 7
If the version is now 8, the update is rejected. The application reloads the latest data and retries, merges changes, or asks the user to resolve the conflict.
The database may briefly lock data during the update; the editing period stays free of that lock.
Core idea: optimistic concurrency uses a version check to prevent overwriting someone else's changes.