Study Vault Search notes, aliases and full text
Graph
ConceptDBISAI-written · not yet proofread

ACID

Also ACID Properties

ACID (atomicity, consistency, isolation, durability) are the four properties a database guarantees for transactions so that changing data stays correct under failures and concurrent access.

Properties#

Why transactions#

So far tables were read once and then only queried (e.g. a new Wikidata dump each month, for which one builds a new database). In many applications the data changes all the time (bank balances, product prices, grades in HISinOne) via

INSERT INTO movies VALUES('Forrest Gump', 1994, 8.8);
UPDATE movies SET rating = 8.9 WHERE title = 'Inception';
DELETE FROM movies WHERE year < 2000;

With changing data, errors become dangerous: a failed read-only query can simply be asked again, but a money transfer that subtracted the amount from account XX without adding it to account YY leaves the data wrong.

PropertyGuaranteeThreat addressed
Atomicityall-or-nothing, no partial updates (rollback to the state before the transaction)failure in the middle of a transaction
Consistencyvalid state → valid stateviolation of integrity constraints
Isolationconcurrent execution ≡ some sequential executioninterference of concurrent transactions
Durabilitycommitted changes survive crashespower loss, hardware failure

Example#

Sources#

Search

Type In
↑ ↓ move ↵ open ⇥ next section Ctrl↵ results page Prefix # to search text only