Overview

ACID is what a database transaction promises. Atomicity: every statement commits or none does. Consistency: constraints hold before and after. Isolation: concurrent transactions do not see each other’s intermediate state, to a degree set by the transaction-isolation level. Durability: a committed write survives a crash because the write-ahead-log is flushed first. Wrap any write that spans more than one row or table in a single transaction instead of chaining autocommit statements.

Rules

  • Use ACID for ledgers, inventory, and account state. Relax it only where brief staleness is harmless (base).
  • ACID covers the primary’s committed state, not replica reads; see replication-lag.
  • “Consistency” here means constraint validity. It is not the CAP-theorem consistency of distributed systems.
  • Durability depends on settings: PostgreSQL with synchronous_commit = off can lose the most recent commits in a crash, without corrupting data.