ACID Properties
ACID Properties
ACID Properties
Most of what were calling transactional locking relates to the ability of a database
management system (DBMS) to ensure reliable transactions that adhere to these
ACID properties. ACID is an acronym that stands for Atomicity, Consistency,
Isolation, and Durability. Each of these properties is described in more detail below.
However, all of these properties are related and must be considered together. They
are more like different views of the same object than independent things.
2.1.1 Atomicity
2.1.2 Consistency
Consistency means that transactions always take the database from one consistent
state to another. So, if a transaction violates the databases consistency rules, then
the entire transaction will be rolled back.
2.1.3 Isolation
Isolation means that concurrent transactions, and the changes made within them,
are not visible to each other until they complete. This avoids many problems,
including those that could lead to violation of other properties. The implementation
of isolation is quite different in different DBMS. This is also the property most often
related to locking problems.
2.1.4 Durability
Durability means that committed transactions will not be lost, even in the event of
abnormal termination. That is, once a user or program has been notified that a
transaction was committed, they can be certain that the data will not be lost.
Lock Contention
Lock contention occurs when many database sessions all require frequent access to
the same lock. This is also often called a "hot lock". The locks in question are only
held for a short time by each accessing session, then released. This creates a
"single lane bridge" situation. Problems are not noticeable when traffic is low (i.e.
non-concurrent or low-concurrency situations). However, as traffic (i.e. concurrency)
increases, a bottleneck is created.
Overall, Lock Contention problems have a relatively low impact. They manifest
themselves by impacting and limiting scalability. As concurrency increases, system
throughput does not increase and may even degrade (as shown in Figure 1 below).
Lock contention may also lead to high CPU usage on the database server.
The best way to identify a lock contention problem is through analysis of statistical
information on locks provided by the DBMS (see monitoring section below).