ACID
ACID is the four properties of relational transactions: atomicity (all or nothing), consistency (constraints preserved), isolation (concurrency without interference), and durability (committed data is never lost).
Purpose
To guarantee transactions remain correct and reliable under failures and concurrency; the core promise of relational databases.
Mechanism
Atomicity: a transaction fully commits or fully rolls back (undo log). Consistency: constraints hold before and after the transaction. Isolation: concurrent transactions are equivalent to a serial order (locks/MVCC). Durability: commits are written to persistent storage (redo log/WAL). Isolation levels from weak to strong: read uncommitted → read committed → repeatable read → serializable.
Use cases
- Financial transfer transactions
- Orders and inventory deduction
- Multi-table relational updates
- Businesses requiring strong consistency
Examples
- Input
BEGIN; UPDATE...; INSERT...; COMMITOutputAtomic commit or rollbackAll or nothing
Common errors
- Long transactions holding locks cause blocking
- Shorten transactions; use optimistic locking
Related terms
BASE
BASE is the weak-consistency NoSQL model: basically available, soft state, eventually consistent — trading strong consistency for availability and scalability. GLOSSARY
CAP Theorem
The CAP theorem states that under network partition a distributed system can satisfy only one of consistency (C) or availability (A); all three cannot hold at once. GLOSSARY
Isolation Level
Isolation levels define visibility between concurrent transactions, from read uncommitted to serializable; higher levels give stronger consistency but lower concurrency. GLOSSARY
Transaction
A transaction is a group of operations executed as a single logical unit satisfying ACID properties — all or nothing. GLOSSARY