Skip to content
uencoder

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...; COMMIT
    Output
    Atomic commit or rollback

    All or nothing

Common errors

Long transactions holding locks cause blocking
Shorten transactions; use optimistic locking

Related terms

References