4.4.26 · D2Databases

Visual walkthrough — BASE vs ACID

1,731 words8 min readBack to topic

Step 1 — What a "node" is, and why there is more than one

WHAT. A node is one computer that stores a copy of your data. When we say a system is distributed, we mean the same piece of data lives on several nodes at once — this copying is called replication (see Replication and Partitioning).

WHY start here. The whole ACID-vs-BASE argument only appears once there is more than one copy. On a single machine, being strict is cheap and free of dilemmas. The tension is born the moment a second copy exists, because now two copies can disagree.

PICTURE. Two nodes, and , each holding a value we'll call . A wire connects them so they can tell each other about changes.

Figure — BASE vs ACID

Step 2 — What "consistent" and "available" mean, drawn as promises

WHAT. We name the two promises a database might try to keep:

  • Consistency (C)every read returns the newest write. If someone just set , nobody anywhere is allowed to read the old .
  • Availability (A)every request gets a real answer (never an error, never an endless wait).

WHY define them so sharply. The CAP theorem is a statement about these exact words. Loose definitions hide the conflict; sharp ones make it unavoidable. Notice is about never being wrong and is about always answering — already they smell like opposites.

PICTURE. A reader asks node "what is ?". Green speech bubble = a fresh, correct answer (both C and A happy). We'll break this in the next step.

Figure — BASE vs ACID

Step 3 — The partition: what happens when the wire dies

WHAT. A partition (P) is when the wire between nodes stops delivering messages. and are both alive and serving users, but they cannot talk to each other.

WHY this is the crux. Networks are physical — cables cut, routers reboot, packets drop. So partitions are not a choice, they are a fact (this is why distributed systems must tolerate them). The theorem asks: while the wire is dead, what can you still promise?

PICTURE. The same two nodes, but the wire is now a broken red dashed line. A write arrives at ; has no way to hear about it.

Figure — BASE vs ACID

Step 4 — The forced fork: a reader arrives during the partition

WHAT. During the partition, a user asks for . But 's copy still says , while the true latest write (at ) is . faces a fork with exactly two options — there is no third.

WHY only two. By the sharp definitions in Step 2, must either return a value or not:

  • Answer with → it responded, so A holds; but , so C breaks.
  • Refuse / wait until the wire heals → the answer is correct-or-nothing, so C holds; but it did not respond, so A breaks.

PICTURE. A single fork diagram: one arrow to "return 5 (stale)" marked A ✓ C ✗, the other to "refuse / block" marked C ✓ A ✗.

Figure — BASE vs ACID

Step 5 — Naming the two roads: CP and AP

WHAT. The two branches of Step 4 are the two families of databases:

  • CP (Consistency + Partition-tolerance): pick the "refuse/block" road. This is the ACID-leaning choice — it would rather make you wait than tell you .
  • AP (Availability + Partition-tolerance): pick the "return stale" road. This is the BASE-leaning choice — it answers now and fixes it later.

WHY these labels. Both keep (mandatory, Step 3). They differ only in which of / they sacrifice — precisely the fork of Step 4. So the abstract theorem becomes a concrete engineering label.

PICTURE. Two panels. Left (CP): shows a "please wait" stop-sign. Right (AP): cheerfully returns with a small clock icon meaning "I'll be right soon."

Figure — BASE vs ACID

Step 6 — Degenerate case: the wire is healthy

WHAT. Rewind to before the partition, when the wire works. Now a write at is copied to almost instantly. A reader at gets both C and A hold at once.

WHY show this. It stops a false lesson. CAP does not say "you can never have C and A together." It says you can't have them together only while a partition is active. When the network is fine, a good system gives you both. The trade-off is a partition-time trade-off.

PICTURE. Healthy wire (solid green). Write flows ; both nodes read ; reader gets a green correct answer.

Figure — BASE vs ACID

Step 7 — Degenerate case: partition heals (how AP "catches up")

WHAT. The wire comes back. The AP system, which had answered stale , now lets hear the missed write and update to . After this reconciliation both copies agree again.

WHY this matters. It shows why "eventual" is a promise, not a hope. AP didn't abandon correctness — it deferred it. Given no new writes, the copies are guaranteed to converge. You lost the timing of correctness, never the destination.

PICTURE. Three frames left→right: (1) split copies ; (2) wire heals, sync message flies; (3) both , labelled "converged".

Figure — BASE vs ACID
Recall Why this rescues the "eventual" objection

Question: does AP mean the data is wrong forever? ::: No — once the partition heals and no new writes arrive, replicas converge to the same value; you only lost the moment, not the outcome.


The one-picture summary

Everything above is a single decision tree. Is the wire alive? If yes → you get C and A (Step 6). If no (a partition) → you hit the fork (Step 4) and must pick a road: CP blocks to stay correct (ACID), AP answers stale then reconciles (BASE, Steps 5 & 7).

Figure — BASE vs ACID
Recall Feynman retelling — the whole walkthrough in plain words

Two friends each keep a copy of a number in a shared notebook, linked by a phone line. While the phone works, one tells the other the moment the number changes, so both are correct and both answer instantly — no problem at all. Now the phone line dies. Friend A changes the number to 6; friend B never hears. Someone asks friend B, "what's the number?" B has only two honest choices: say "5" (fast, but out of date), or say "hang on, I can't reach A" (correct, but leaves you waiting). There is no third option — B simply doesn't know the new value. Choosing "wait until I can check" is the CP / ACID friend — never wrong, sometimes silent. Choosing "here's 5 for now, I'll fix it when the line's back" is the AP / BASE friend — always answers, briefly stale, and truly does catch up the instant the phone works again. That's the entire theorem: broken line ⇒ pick correct or always-answering, not both. Working line ⇒ you happily get both.