ACID vs BASE
ACID (Atomicity, Consistency, Isolation, Durability) guarantees database transactions behave correctly even under failures. BASE (Basically Available, Soft state, Eventually consistent) is the weaker model adopted by many distributed databases to gain availability and partition tolerance.
ACID = a bank vault (every transaction locked down tight, nothing gets lost). BASE = a coffee shop tip jar (roughly right, eventually counted, nobody panics if a penny is off).
ACID: Atomicity — transaction commits entirely or not at all. Consistency — DB moves from one valid state to another. Isolation — concurrent transactions don't interfere. Durability — committed data survives crashes (via WAL). BASE: Basically Available — system responds even during partial failures (possibly with stale/partial data). Soft state — state may change over time even without input (convergence). Eventually consistent — replicas will converge given no new writes.
Isolation is the most nuanced ACID property. SQL standard defines four isolation levels: Read Uncommitted, Read Committed, Repeatable Read, Serializable. PostgreSQL's default is Read Committed; MySQL InnoDB defaults to Repeatable Read. Serializable (via Serializable Snapshot Isolation in PostgreSQL) prevents all anomalies but reduces throughput. Most production systems operate at Read Committed and handle application-level anomalies explicitly. Two-phase commit (2PC) extends ACID across distributed nodes but is slow (two network round trips) and blocks on coordinator failure. Google Spanner achieves distributed ACID using TrueTime (GPS + atomic clocks) for external consistency — a global wall clock with bounded uncertainty.
For financial transactions, inventory management, or any system where correctness is non-negotiable, I'd use ACID transactions. For systems that can tolerate eventual consistency — social feeds, view counts, recommendation updates — BASE is fine and enables better horizontal scalability. I'd be explicit: 'The payment deduction is ACID; the feed update is eventually consistent with a max lag SLO of 5 seconds.'
Thinking BASE means 'no consistency at all.' Eventual consistency still guarantees convergence — all replicas will eventually agree. The question is the convergence window and what you do during that window.