Systems & Backend

ACID

The four guarantees — Atomicity, Consistency, Isolation, Durability — that make database transactions reliable.

ACID describes the guarantees a transactional database makes: Atomicity (all of a transaction happens or none of it), Consistency (it moves the database from one valid state to another), Isolation (concurrent transactions do not corrupt each other), and Durability (once committed, it survives a crash).

Worked example: a bank transfer debits one account and credits another; atomicity guarantees you cannot debit without the matching credit even if the server dies mid-transaction. Gotcha: isolation has levels (read-committed, repeatable-read, serializable) that trade correctness for concurrency — the default is often weaker than serializable, so anomalies like non-repeatable reads are possible unless you ask for more.