CONCEPT SHEET · Concepts

ACID vs BASE

One-liner: ACID is the transactional guarantee set of relational DBs; BASE is the availability-first posture of distributed NoSQL stores.

ArticleConcepts© Arthur Bernier Jr473 words1 code block

Say this#

How it works#

ACID (Postgres, MySQL, Oracle, Spanner):

  1. BEGIN; writes go to WAL + buffer pool.
  2. Locks or MVCC snapshots give isolation.
  3. COMMIT fsyncs the WAL record → durable. Crash recovery replays WAL.

BASE (Cassandra, DynamoDB, Riak, early Mongo):

  1. Write accepted by any available replica (tunable W).
  2. Replicated asynchronously / via gossip; hinted handoff for down nodes.
  3. Conflicts resolved by last-write-wins, vector clocks, or CRDTs; read repair fixes stragglers.
TEXT
ACID: client -> single leader -> WAL -> commit -> ackBASE: client -> any node -> ack -> async replicate -> converge

Trade-offs#

ChoiceProCon
ACID single-nodeSimple reasoning, joins, constraintsVertical scale ceiling, single point for writes
ACID distributed (Spanner, CockroachDB)Strong guarantees at scaleCross-region commit latency (2PC + consensus), cost
BASEHorizontal scale, always-writable, partition-tolerantApp must handle stale reads and conflicts
Serializable isolationNo anomaliesLower throughput, more aborts/retries
Read Committed (Postgres default)Fast, few abortsNon-repeatable reads, phantoms possible

Numbers#

  • Postgres default isolation: Read Committed. MySQL InnoDB default: Repeatable Read.
  • Single Postgres node: order of thousands to low tens of thousands of writes/s depending on fsync and row size.
  • Cross-region 2PC commit adds at least one WAN round trip (~50-150 ms).
  • Serializable in Postgres is SSI (serializable snapshot isolation), not 2PL.

In the interview#

See also