ACID Properties
ACID is an acronym describing four guarantees — Atomicity, Consistency, Isolation, and Durability — that traditional relational database transactions provide to ensure reliable processing even in the presence of errors, crashes, or…
Definition
ACID is an acronym describing four guarantees — Atomicity, Consistency, Isolation, and Durability — that traditional relational database transactions provide to ensure reliable processing even in the presence of errors, crashes, or concurrent access.
Overview
Atomicity guarantees that a transaction is all-or-nothing: if any part of a multi-statement operation fails, the entire transaction rolls back as though it never happened, so a bank transfer can never debit one account without crediting the other. Consistency ensures a transaction takes the database from one valid state to another, respecting all constraints, triggers, and rules defined on the schema — this is the same consistency underpinned by good database normalization and constraint design. Isolation controls how concurrent transactions see each other's uncommitted changes, governed by isolation levels (read uncommitted, read committed, repeatable read, serializable) that trade strictness for throughput. Durability guarantees that once a transaction commits, its effects survive subsequent crashes, typically via write-ahead logging to durable storage. Relational databases like PostgreSQL, MySQL (with InnoDB), and Microsoft SQL Server implement ACID transactions natively, making them a natural fit for OLTP workloads like payments, inventory, and order processing where correctness under concurrent access is non-negotiable. Many NoSQL databases historically relaxed some ACID guarantees in favor of availability and partition tolerance, per the CAP theorem trade-off, though systems like MongoDB have since added multi-document ACID transaction support. ACID is often contrasted with BASE (Basically Available, Soft state, Eventually consistent), a looser consistency model favored by some distributed and NoSQL systems that prioritize availability and horizontal scale over strict, immediate consistency. Understanding where a given application sits on this spectrum — and which isolation level a query actually needs — is a core skill covered in database-focused courses like PostgreSQL Mastery.
Key Concepts
- Atomicity: transactions are all-or-nothing, with automatic rollback on failure
- Consistency: transactions move the database between valid states per its constraints
- Isolation: configurable levels control visibility of concurrent uncommitted changes
- Durability: committed changes survive crashes via write-ahead logging
- Native support in relational engines like PostgreSQL, MySQL (InnoDB), and SQL Server
- Contrasted with the looser BASE model favored by some distributed NoSQL systems
- Isolation level choice trades strictness for concurrency and throughput