Comparisons

Ten pairs that get conflated in real conversations. Neither column wins — what decides is the requirement. Each record leads with the confusion, because the confusion is the reason the record exists.

Optimistic vs Pessimistic concurrency

What people get wrong about this pair

Optimistic is read as "no locking" — but the database still takes locks during the update; what you avoided is holding one across the user's thinking time. And the version check is worthless unless the update is conditional on the version in the same statement.

Optimistic (version check on write)
Use it when

Low contention: conflicts are rare, and a retry or a "someone else changed this" message is acceptable.

Pessimistic (lock the row first)
Use it when

High contention on a hot row, or a sequence of reads and writes that must not interleave at all.

DimensionOptimistic (version check on write)Pessimistic (lock the row first)
Conflict detectedAt write timePrevented at read time
Held resourceNothing between read and writeA row lock, and the connection holding it
Cost under contentionWasted work and retriesWaiting, and a deadlock risk from lock ordering
User experienceMay be told to retryWaits, or times out acquiring
Works across requestsYes — version travels with the payloadOnly within one transaction
Watch out forRetry loops that never converge on a hot rowLocks held while calling a third party