Unit 4_Concurrency Control
Unit 4_Concurrency Control
Computer systems, both software and hardware, consist of modules, or components. Each
component is designed to operate correctly, i.e., to obey to or meet certain consistency
rules. When components that operate concurrently interact by messaging or by sharing
accessed data (in memory or storage), a certain component's consistency may be violated
by another component. The general area of concurrency control provides rules, methods,
design methodologies, and theories to maintain the consistency of components operating
concurrently while interacting, and thus the consistency and correctness of the whole
system. Introducing concurrency control into a system means applying operation
constraints which typically result in some performance reduction. Operation consistency
and correctness should be achieved while still maintaining reasonable operation
efficiency.
Contents
[hide]
o 2.2 References
• Atomicity - Either the effects of all or none of its operations remain when a
transaction is completed (committed or aborted respectively). In other words, to
the outside world a committed transaction appears to be indivisible, atomic. A
transaction is an indivisible unit of work that is either performed in its entirety or
not performed at all ("all or nothing" semantics).
• Consistency - Every transaction must leave the database in a consistent state, i.e.,
maintain the predetermined integrity rules of the database (constraints upon and
among the database's objects). A transaction must transform a database from one
consistent state to another consistent state.
• Isolation - Transactions cannot interfere with each other. Moreover, an
incomplete transaction is not visible to another transaction. Providing isolation is
the main goal of concurrency control.
• Durability - Effects of successful (committed) transactions must persist through
crashes.
• Optimistic - Delay the checking of whether a transaction meets the isolation and
other integrity rules (e.g., serializability and recoverability) until its end, without
blocking any of its (read, write) operations, and then abort a transaction if the
desired rules are violated.
• Pessimistic - Block an operation of a transaction if it may cause violation of the
rules until the possibility of violation disappears.
• Semi-optimistic - Block operations in some situations, if they may cause
violation of some rules, and do not block in other situations while delaying rules
checking to transaction's end, as done with optimistic.
Many methods for concurrency control exist. Most of them can be implemented within
either main category above. Major methods, which have each many variants, and in some
cases may overlap or be combined, include:
Concurrency control also ensures the Recoverability property for maintaining correctness
in cases of aborted transactions (which can always happen for many reasons).
Recoverability means that committed transactions have not read data written by aborted
transactions. None of the mechanisms above provides recoverability in its general form,
and special considerations and mechanism enhancements are needed to support
recoverability. A commonly utilized special case of recoverability is Strictness, which
allows efficient database recovery from failure, but excludes optimistic implementations
(the term "semi-optimistic" appeared for the first time in conjunction with Strict CO
(SCO)).