Transactions & ACID
A transaction is a group of operations that either all succeed or all fail together. ACID is the set of guarantees that make this work: Atomicity (all-or-nothing), Consistency (data stays valid), Isolation (concurrent transactions don't interfere), and Durability (committed data survives crashes). Isolation levels control how visible uncommitted changes are to other transactions. Read Committed (the Postgres default) prevents dirty reads but allows non-repeatable reads. Serializable provides the strongest guarantee but reduces concurrency. Most applications work well at Read Committed — only use Serializable for financial operations where phantom reads would cause real money problems.