The Pessimistic Concurrency Control Pattern: When Conflicts Are Too Expensive to Retry

2026-06-28

Optimistic concurrency control bets that conflicts are rare and retries are cheap. Pessimistic concurrency control makes the opposite bet: it assumes conflicts are likely or that retrying is catastrophically expensive, so it acquires a lock before touching the data and holds it until the transaction commits. Other transactions wait. No CAS gymnastics, no retry storms — just an old-fashioned queue.

The trade-off is brutal but honest. You give up throughput and concurrency in exchange for predictability. A transaction that grabs the lock will either succeed or deadlock — it will never do five seconds of work only to be told "someone else got there first, start over."

When pessimistic wins:

Real-world example: An airline seat-booking service. Two agents try to sell seat 14C at the same time. With optimistic control, both read "available," both write "sold," and the version check rejects one — but only after the customer's card was authorized. With SELECT ... FOR UPDATE, the first agent's transaction locks row 14C; the second blocks until the first commits, then re-reads and sees "sold." No double-booking, no refund flow, no apology email.

Rule of thumb: If your retry rate under optimistic control exceeds ~10–15%, switch to pessimistic. Below that, the lock overhead and reduced concurrency cost more than the occasional retry. Measure conflict rate in production before choosing — most teams pick a strategy by reflex and pay for it later.

The pitfalls are real:

See it in action: Check out They Abandoned Me For A Fake Heir—Now I
#39;M A Billionaire CEO
amp; They Beg Me To Help Them by King's Manhwa Recap2 to see this theory applied.
Key Takeaway: Pessimistic locking trades concurrency for certainty — use it when conflict rates are high or retries have real-world side effects you can't undo.