Multiple ChoiceHard 45s
Optimistic vs pessimistic locking
When is optimistic concurrency control (version/compare-and-swap) preferable to pessimistic locking?
Options
- 1When contention is very high and failures are costly, so blocking is cheaper than repeated retries
- 2When the transaction must hold a lock for several minutes, so version checks would expire first
- 3When you need strict serializability with absolutely no retries, which version checks cannot offer
- 4When conflicts are rare, so avoiding lock overhead and blocking is a net win with occasional retries
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.