Optimistic Concurrency Control and Validation

Allow speculative reads and private updates, then validate what changed before making the transaction’s writes visible.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Execution collects evidence for a later check
  2. The validation result must remain true through publication

Execution collects evidence for a later check

An optimistic transaction can read data and compute tentative writes without holding long-lived locks on every read. It tracks versions or other read-set dependencies. At validation, compare that evidence against concurrent changes under the protocol’s chosen serialization order. If another transaction changed a value that the current outcome relied on, the current transaction may need to retry.

The validation result must remain true through publication

Suppose a transaction reads version \(5\) of a setting and creates a derived record. If version \(6\) commits before validation, checking the read dependency can reject the stale result. If validation and publication are separated by a race, further changes can invalidate the decision. Predicates and absent rows also need representation where relevant. Isolation anomalies state which histories matter. Two-phase locking coordinates conflicts through a different lifetime of protection.[1][2]

References

  1. H. T. Kung and John T. Robinson, On Optimistic Methods for Concurrency Control ↩
  2. CMU 15-445/645, Introduction to Database Systems: Lectures ↩