Design Patterns · Middle · Question 58 of 75
How do you prevent two users from silently overwriting each other's edits of the same record?
- ✓Correct answer: Optimistic concurrency: send a version (or ETag) with the update and reject it if the record changed meanwhile
- 2Lock the record whenever anyone opens the page
- 3Last write always wins
Explanation
On conflict the UI can show a diff or reload the latest data. HTTP supports this with If-Match and 412 Precondition Failed.