Databases · Multiple choice

When does pessimistic locking (SELECT … FOR UPDATE) beat optimistic concurrency (a version check at write time)?

medium Consistency

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.

Review this in your daily deck All cards in Databases