Home / Learn Secure SQL / ACID: the Four Guarantees of a Transaction
ACID: the Four Guarantees of a Transaction
Atomicity, Consistency, Isolation, Durability.
In shortAtomicity, Consistency, Isolation, Durability.
What's actually going on
The basic idea
ACID describes four guarantees a proper transaction gives you: all-or-nothing, rules always hold, transactions do not interfere with each other, and committed data survives a crash.
Why this comes up
Knowing these guarantees lets you reason precisely about what can and cannot go wrong when several requests touch the database at once.
The mechanics
Wrap related changes in a transaction and trust the database to provide all four guarantees for you.
Where it is used
- Web application code review
- Backend development
- Database administration
| Letter | Guarantee | Everyday example |
|---|---|---|
| A | Atomicity | A money transfer either fully happens or not at all |
| C | Consistency | A CHECK constraint is never violated, even mid-crash |
| I | Isolation | Two concurrent transfers do not corrupt each other's math |
| D | Durability | Once COMMIT returns, the change survives a power cut |
Quick check
1. ACID is a set of guarantees about...
Transactional correctness.