Concepts and theorems · Intermediate

ACID: four distinct transaction properties

Use a transfer example to separate atomicity, consistency, isolation, and durability without treating the acronym as one unlimited guarantee.

Ask Logeia about this articleTry the three questionsReview your answers

Updated

On this page
  1. Four questions, not one magic label
  2. Atomicity in a transfer
  3. Consistency and isolation interact
  4. Durability and external effects
  5. Ask Logeia about this articleCheck your understanding

Four questions, not one magic label

ACID groups four transaction properties: atomicity, consistency, isolation, and durability. Atomicity concerns committing a group of changes together or discarding it. Isolation concerns interactions among concurrent transactions. Durability concerns retaining committed changes through the failures covered by the system contract. Consistency concerns preservation of specified constraints and invariants. The acronym is a useful checklist, not one unlimited guarantee. The actual isolation level, storage settings, and failure model still matter, and an application must express the rules it expects the database to preserve.

PropertyQuestion to ask
AtomicityCan only part of the unit commit?
ConsistencyAre specified invariants preserved?
IsolationWhich concurrent outcomes are allowed?
DurabilityWhich failures can committed changes survive?

Atomicity in a transfer

Consider transferring ten units by subtracting ten from account A and adding ten to account B. Grouping both updates in one transaction lets the system avoid committing only half of that transfer when an operation fails. This illustrates atomicity. It does not establish that B is the intended recipient or that the application correctly handles insufficient funds. Wrapping incorrect logic in BEGIN and COMMIT does not repair it. Business checks and data constraints must be designed alongside the transaction boundary rather than inferred from the presence of transaction syntax.

Consistency and isolation interact

An invariant such as a nonnegative balance can be expressed through appropriate constraints and correct update logic. When concurrent operations make decisions from the same earlier state, isolation or explicit locking can also matter. Successful individual statements do not automatically prove that a cross-row invariant survives every concurrent history. Define the invariant and transaction boundary, then decide how conflicts are handled: waiting, rejection, and retry have different operational consequences. Consistency is therefore not an invitation to delegate unspecified business meaning to the database; it depends on what has actually been encoded.

Durability and external effects

Durability is a contract about which committed changes survive which failures. Logging and storage synchronization participate in that contract, and performance-oriented settings can change its conditions. A database commit is also not automatically atomic with an email send or work performed by another service. Recovery and retries need an explicit strategy for those external effects, including possible duplicates. Do not use the word ACID as a substitute for an end-to-end exactly-once claim across arbitrary systems. State the database boundary and failure assumptions, then design the surrounding workflow accordingly.

Reading and practice are recorded separately in this browser, for each language.

Learn this in order

Understand the systems behind the web · STEP 13

Choose a learning path