A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

ACID Properties

College Depth 81 in the knowledge graph ☐ I know this ☆ Set as goal
27topics build on this
359prerequisites beneath it
See this on the map →
Database TransactionsSQL: INSERT, UPDATE, and DELETE (DML)→→CAP TheoremConcurrency Control in Databases+4 more
ACID atomicity consistency isolation durability transaction guarantees

Core Idea

ACID is an acronym for four properties that guarantee reliable transaction processing: Atomicity (all-or-nothing execution — a failure mid-transaction rolls back all changes), Consistency (a transaction brings the database from one valid state to another, preserving all defined invariants), Isolation (concurrent transactions execute without interfering, as if serialized), and Durability (committed transactions survive crashes and power loss). Enforcing full ACID requires logging, locking, and recovery protocols that add overhead, which is why some distributed systems deliberately relax these guarantees.

How It's Best Learned

Work through scenarios that would violate each property: crash mid-transfer (atomicity), violate a constraint mid-transaction (consistency), read uncommitted data (isolation), lose a commit after crash (durability). Understand what mechanisms prevent each failure.

Common Misconceptions

Explainer

You already understand that a database transaction groups multiple operations into a single logical unit — a bank transfer that debits one account and credits another, for example. ACID describes the four guarantees a database must provide for transactions to behave reliably, even in the face of crashes, concurrent access, and hardware failures. Each letter names a specific promise, and understanding the mechanisms behind each one reveals why databases are engineered the way they are.

Atomicity means a transaction is all-or-nothing. If a bank transfer debits $500 from Account A but crashes before crediting Account B, atomicity guarantees the debit is rolled back — the database never ends up in a state where money simply vanished. Databases achieve this using a write-ahead log (WAL): before modifying any data page, the database first writes a log record describing the intended change. On crash recovery, the database replays committed transactions from the log and undoes uncommitted ones. The log is the source of truth for what happened, and it is what makes rollback possible.

Consistency means a transaction must transition the database from one valid state to another, respecting all declared constraints — primary keys, foreign keys, CHECK constraints, unique constraints, and triggers. If your schema says an account balance cannot be negative, any transaction that would create a negative balance is rejected. This is sometimes the most misunderstood ACID property because "consistency" means something different in distributed systems (the C in CAP theorem refers to linearizability, an entirely different concept). In ACID, consistency is about application-level invariants enforced by the schema.

Isolation ensures that concurrent transactions do not interfere with each other. Without isolation, one transaction might read half-written data from another, producing phantom results or lost updates. Full isolation (the SERIALIZABLE level) makes concurrent transactions behave as though they ran one at a time. But serializable execution is expensive — it requires extensive locking or validation — so SQL defines weaker isolation levels (READ COMMITTED, REPEATABLE READ) that trade some isolation guarantees for better throughput. Understanding which anomalies each level permits (dirty reads, non-repeatable reads, phantom reads) is essential for choosing the right level for a workload.

Durability guarantees that once a transaction commits, its effects survive any subsequent failure — power loss, OS crash, disk failure. The WAL again plays a central role: a transaction is not considered committed until its log records are flushed to stable storage. Even if the in-memory data pages are lost in a crash, the database can reconstruct committed state from the log. Replication and backups extend durability guarantees beyond single-machine failures. Together, these four properties form the contract that makes relational databases trustworthy for financial systems, medical records, and any application where data correctness is non-negotiable.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Conditional Statements → Defining and Calling Functions → Functions: Decomposing Problems → Function Parameters and Argument Passing → Return Values → Error Handling and Exceptions → File I/O Basics → File System Concepts → Database Transactions → ACID Properties

Longest path: 82 steps · 359 total prerequisite topics

Prerequisites (2)

Leads To (6)