Atomicity, Consistency, Isolation, Durability (ACID)
ACID (Atomicity, Consistency, Isolation, Durability) describes the fundamental properties of reliable database systems.
- Atomicity: Ensure DB transactions are treated as a single, indivisible unit.
- Either all operations are completed successfully, or none of them are
- If a transaction fails, the DB is left in same state as before
- Consistency: Ensure DB remains in valid state before and after a transaction.
- DB disallows a transaction if it violates any integrity constraints
- E.g. a transaction inserting a duplicate record should be rejected
- Isolation: Ensure concurrent transactions do not interfere with each other.
- Each transaction is executed as if it were the only transaction occurring
- Prevents inconsistent results due to race conditions
- Durability: Ensure committed transactions remain committed
- Changes are permanently stored in the DB
- System failures can be recovered from