Skip to content
IT glossary
DatabasesUpdated December 3, 2026

ACID

Four properties of database transactions: changes take effect as a unit, data rules stay intact, concurrent work interacts in controlled ways, and committed changes survive failures.

What ACID means

Imagine a checkout that creates an order and reserves the last item in stock. If the reservation fails, the store should not end up with a confirmed order it cannot fulfill. A database transaction lets the application treat these updates as one unit of work. ACID describes four different guarantees about that unit.

  • Atomicity: all or nothing. Either every change in the transaction commits, or none does. If the transaction rolls back, the database does not retain the order insert on its own.
  • Consistency: preserve the rules. A successful transaction takes the database from one valid state to another. The database can enforce declared rules such as unique order IDs or a foreign key from an order line to its order. It cannot infer business rules that the schema and transaction logic never express.
  • Isolation: control interference. The isolation level determines how concurrent transactions can affect one another. At SERIALIZABLE, the outcome of successful transactions must match some order in which they ran one at a time. Weaker levels can permit anomalies, such as a second read returning a different value because another transaction committed in between.
  • Durability: a confirmed commit survives a crash. Within the database's configured failure guarantees, committed changes are recoverable even if the server stops immediately after acknowledging the commit. Many engines use a log stored on durable media to recover those changes. Surviving a server crash is not the same as surviving the loss of the storage device.

Example: reserving the last item

Inside a transaction, an application can issue a conditional update instead of reading the stock count and later writing back a value it calculated:

UPDATE inventory
SET available = available - 1
WHERE sku = 'MUG-01' AND available > 0;

Assuming sku is unique, one affected row means the transaction reserved a unit. Zero means no row matched; that is not a SQL error. The application inserts the order and commits only after a successful reservation. If the insert fails, it rolls back the transaction, which also undoes the stock change. If the database reports a serialization failure, the application can retry the entire transaction rather than just the last statement.

Where the guarantees stop

ACID matters for operations such as recording ledger entries, booking seats, or updating inventory. The guarantees apply within the transaction's scope: rolling back a database transaction does not unsend an email or reverse an API call. Also, ACID consistency is about preserving data rules; consistency in the CAP theorem concerns what clients observe when they read and write distributed data.

How it comes up in interviews

Expect a scenario rather than just a request to expand the acronym. If two shoppers both read that one item is left, ask what happens when each proceeds to place an order. Explain why wrapping a read-then-write sequence in a transaction may not be enough at the chosen isolation level, and show how a conditional update plus an affected-row check changes the outcome.