Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M6275

Optimistic Locking

Optimistic Locking
TechnicalHigh supportSoftware Engineering
Included
account_tree

Version 1.0.0 · Updated 2026-07-28

CORE DEFINITION

In relational database management systems, optimistic concurrency control (also known as "optimistic locking", abbreviated as "OCC") is a concurrency control method. It assumes that multi-user concurrent transactions will not affect each other during processing, and each transaction can process the part of data it affects without generating locks. Before committing data updates, each transaction first checks whether other transactions have modified the data after it was read. If other transactions have updated it, the committing transaction will roll back. Optimistic transaction control was first proposed by Professor H.T. Kung. Optimistic concurrency control is mostly used in environments with low data race and few conflicts. In such environments, the cost of occasionally rolling back transactions is lower than the cost of locking data when reading, thus achieving higher throughput than other concurrency control methods.

SCAFFOLDING EFFECT

psychology

Reduce cognitive load

In relational database management systems, optimistic concurrency control (also known as "optimistic locking", abbreviated as "OCC") is a concurrency control method. It assumes that multi-user concurrent transactions will not affect each other during processing, and each transaction can process the part of data it affects without generating locks. Before committing data updates, each transaction first checks whether other transactions have modified the data after it was read. If other transactions have updated it, the committing transaction will roll back.

anchor

Anchor fast decisions

Database concurrency control: assumes few conflicts, no locking when reading, and checks at commit time whether the data version/timestamp has been modified by others. If modified, conflict and retry. The mechanism is to replace "pre-locking" with "detect conflict + retry", significantly reducing blocking and improving throughput in read-heavy, write-light scenarios.

MINIMUM ACTION

In progress 0/5

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%
account_treeGenealogyexpand_more
menu_bookReferencesexpand_more

Source support: Explicit

  • link
    zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E4%B9%90%E8%A7%82%E5%B9%B6%E5%8F%91%E6%8E%A7%E5%88%B6ZH · Explicit
    verified

RELATED MODELS