version column
A column incremented on every update, used to detect that a row changed between read and write.
In more detail
An update includes the version it read in its condition; if another writer got there first, no row matches and the write is rejected. This is the optimistic guard against lost updates.
Related terms
- optimistic concurrency control — A way to prevent lost updates by reading a version, preparing a change, and making the write succeed only if that version is still current.
- lost update — A concurrency bug where two sessions read the same value, both write a result based on it, and the later write silently erases the earlier one.
Taught in
- Worked Design One: Ticket Booking, Correctness First — Scalable System Design & Distributed Architecture