CMD Guide
HomeSystem DesignDatabases

ACID vs BASE Properties

ACID and BASE are two answers to the same mechanical problem — how a database keeps data correct while machines crash and requests race — where ACID force-orders every write through a durable log plus locks (or versioning) so a commit lands atomically and becomes visible everywhere at once, and BASE lets independent replicas accept writes and reconcile them afterward so the system never stops answering.

They are not good-vs-bad; they are different placements of one dial: who pays for consistency, and when. ACID makes the database pay it up front (locks, coordination, latency) so your application code can assume the data is always correct. BASE hands that cost to you — the application must tolerate and reconcile temporary disagreement — in exchange for staying available and scaling across many machines. The rest of this page shows the machinery behind each, traces both with real numbers, corrects the usual CAP shorthand, and gives the decision rule a senior engineer actually uses.

ACID: the four guarantees and the machinery behind them

A transaction is a bundle of steps treated as one unit (transfer money, book a seat). ACID is four promises about that unit, and each is delivered by a specific mechanism — not by good intentions:

The diagram below shows how one log line does most of the heavy lifting for both atomicity and durability.

diagram
diagram

Traced: a $100 transfer that survives a crash

Account A starts at $500, B at $100; the invariant is total = $600. We transfer $100 from A to B. Follow the engine step by step — the row where it becomes durable is the pivot.

StepActionOn disk?Visible to others?
1BEGIN; read A=500; check A ≥ 100 ✓no
2Append WAL record "A: 500→400", fsyncloggedno
3Append WAL record "B: 100→200", fsyncloggedno
4Apply in buffer pool: A=400, B=200not yetno (isolation)
5Write COMMIT to WAL, fsync ← durability pointcommittedyes, now
6Return success to the clientcommittedyes
7Background: flush data pages to the data filefully persistedyes

Crash after step 5, before step 7: restart, engine sees the COMMIT record, REDOs it → A=400, B=200, total 600. Durability held. Crash after step 3, before step 5 (no COMMIT): restart discards the incomplete transaction → A=500, B=100, total 600. Atomicity held. The one state ACID makes impossible is A=400 with B=100 — $100 vanished. That impossibility is the guarantee, and it costs the two fsyncs and the isolation lock held across steps 1–6.

BASE: available first, consistent eventually

BASEBasically Available, Soft state, Eventually consistent — is the philosophy of most large distributed and NoSQL stores. Instead of coordinating every write globally before answering, replicas accept writes locally and propagate them asynchronously:

The mechanism that buys availability is exactly what creates the anomaly window, as the next diagram traces.

diagram
diagram

Traced: one sneaker, two orders

A limited sneaker has stock = 1, replicated to two regions with last-write-wins reconciliation. Replication lag is ~200 ms.

Nothing here is a bug in the store; it did exactly what BASE promises. The oversell is the application's problem to reconcile (cancel-and-refund, backorder, or gate the checkout through a strongly-consistent counter). That relocation of the correctness burden from the database to your code is the true price of BASE — and it is easy to under-budget.

CAP, stated correctly (not "pick two of three")

The popular slogan — a distributed system can guarantee only two of Consistency, Availability, and Partition tolerance — is misleading, and it is the one thing worth unlearning here. In any real system spanning more than one machine, network partitions are not optional: packets drop, links flap, nodes hang. So P is a fact of the environment, not a feature you trade away. That collapses the "three-way" choice into a much sharper one:

ACID / strong-consistency stores lean CP; BASE stores lean AP. And even outside partitions the story continues — PACELC completes it: if Partitioned, choose A or C; Else, choose Latency or Consistency. Synchronous replication for strong reads costs latency on every request, partition or not. So the honest framing is: C-vs-A only under partition, L-vs-C the rest of the time.

diagram
diagram

ACID vs BASE — the trade-off at a glance

DimensionACID (strong consistency)BASE (eventual consistency)
Consistency timingImmediate: reads see the latest commitEventual: reads may be stale for a window
Under partitionLeans CP — may reject writes/reads to stay correctLeans AP — keeps answering, reconciles later
Write pathCoordinated (log + locks; 2PC across nodes)Local to a replica, propagated async
Horizontal scalingHarder — global coordination is the bottleneckNatural — add nodes, shard, replicate
Conflict handlingPrevented by the DB (isolation)Resolved after the fact (LWW, vector clocks, CRDTs, or app logic)
Where correctness livesIn the databaseShared with your application code
Per-request latencyHigher (fsync, quorum, waits)Lower (answer from nearest replica)

When to use ACID, when to use BASE

Decide per operation, not per company. The signal is the cost of a wrong or stale read.

Reach for ACID when a stale or partial read has real-world consequences that are expensive to unwind: money movement, ledgers, inventory decrements that must not oversell, seat/booking allocation, auth and permission changes, anything with an invariant a regulator or an angry customer will check. Concrete signals: "double-spend is unacceptable," "the two writes must both happen or neither," "we need to read our own write immediately," bounded data volume that fits a primary + read replicas.

Reach for BASE when availability and scale dominate and a few seconds of staleness is invisible or cheap to reconcile: feeds, timelines, likes/view counts, product catalogs, sessions, telemetry, notifications, caches. Signals: "the site must never go down globally," "we serve millions of reads across regions," "a like showing up a second late is fine," write volume that no single node can absorb.

Choose ACID (e.g. PostgreSQL, a single-region relational store) when correctness on every read is the product and you can scale by sharding a bounded working set. Prefer BASE (e.g. Cassandra, DynamoDB) when you would rather serve slightly stale data than serve an error, and you are prepared to write the reconciliation logic. The mature answer is usually both: the money path on ACID, the read-heavy experience on BASE — and where the store allows it, turn the dial per query (Cassandra/DynamoDB quorum reads, Mongo majority writes, Postgres synchronous replicas). ACID vs BASE is a spectrum with a knob, not a binary.

Pitfalls

Real systems on each side

The line is blurring: Dynamo and Cassandra let you request stronger reads per query, and Spanner/Cockroach let you relax where you don't need strictness. "ACID or BASE" increasingly means "which end of the dial is this operation's default."

Takeaways


Re-authored and deepened for this guide. Sources: Härder & Reuter, "Principles of Transaction-Oriented Database Recovery" (1983, which coined ACID); Gray & Reuter, Transaction Processing: Concepts and Techniques; Eric Brewer's CAP conjecture (PODC 2000) and "CAP Twelve Years Later" (IEEE Computer, 2012); Daniel Abadi's PACELC formulation (2012); Dan Pritchett, "BASE: An Acid Alternative" (ACM Queue, 2008); DeCandia et al., "Dynamo: Amazon's Highly Available Key-value Store" (SOSP 2007); Martin Kleppmann, Designing Data-Intensive Applications; and the PostgreSQL, MySQL/InnoDB, Cassandra, and DynamoDB documentation.

🤖 Don't fully get this? Learn it with Claude

Stuck on ACID vs BASE Properties? Open Claude, copy a block below, and it'll teach you this exact concept — visually and interactively.

🎨 Explain it visually

Build the mental picture, not memorization.

I just read a lesson on **ACID vs BASE Properties** (System Design) and want to truly understand it. Explain ACID vs BASE Properties from first principles using ONE vivid real-world analogy and a visual mental model — draw it as ASCII art or a clear step-by-step diagram — with a concrete example using real numbers. Then ask me one question to check I got the mental picture, and wait for my reply. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🤔 Walk me through it (interactive)

Socratic — adapts to where you're stuck.

Teach me **ACID vs BASE Properties** interactively. Ask me ONE guiding question at a time, wait for my answer, and adapt to my confusion — build the idea with me step by step instead of explaining it all at once. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧪 Quiz me & fix my gaps

Active recall exposes what you missed.

Quiz me on **ACID vs BASE Properties** with 5 questions, easy to tricky, ONE at a time. Tell me if each answer is right; at the end, explain clearly what I got wrong and why. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🧠 Make it stick

Intuition + hook + flashcards for long-term memory.

Help me remember **ACID vs BASE Properties** for the long term: give the one-sentence intuition, a memorable hook/mnemonic, a tiny worked example, and 3 active-recall flashcards (Q -> A). If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.

📝 My notes