[prev] 25 [next]

Optimistic Concurrency Control

Locking is a pessimistic approach to concurrency control:
  • limit concurrency to ensure that conflicts don't occur
Costs: lock management, deadlock handling, contention.

In scenarios where there are far more reads than writes ...

  • don't lock (allow arbitrary interleaving of operations)
  • check just before commit that no conflicts occurred
  • if problems, roll back conflicting transactions