Options
Why
Optimistic concurrency costs nothing until a conflict, then the loser redoes its work. Under heavy contention most attempts lose, so waiting for a lock is cheaper. With rare conflicts, optimistic wins because nobody waits.
Databases · Multiple choice
SELECT … FOR UPDATE) beat optimistic concurrency (a version check at write time)?Optimistic concurrency costs nothing until a conflict, then the loser redoes its work. Under heavy contention most attempts lose, so waiting for a lock is cheaper. With rare conflicts, optimistic wins because nobody waits.