Why doesn't money vanish when two bank transfers happen at once?
The name ACID was coined in 1983, and its opposite, BASE, was named on purpose to be its chemical counterpart.
▶ Start the storyMoney doesn't vanish because the database treats a transfer as one indivisible unit of work, called a , and follows four rules known as ACID. A bank transfer has two steps: take money from one account, add it to another. If the machine crashed between them, or a second transfer sneaked in halfway, the numbers could end up wrong. ACID is the promise that this never happens.
Atomicity says a either succeeds completely or fails completely. If any step fails, the whole thing fails and the database is left unchanged, so the money can't leave account A without arriving in account B. Consistency says a transaction can only take the database from one valid state to another, respecting its rules. Durability says that once a transaction is committed, it stays committed even through a crash or power cut. To keep that promise, many databases write the change into a log on safe storage first, before touching the data itself.
Step 1: Atomicity
All steps happen, or none do
Step 2: Consistency
Only valid states, rules kept
Step 3: Isolation
Concurrent work acts like one at a time
Step 4: Durability
Committed means it stays, even after a crash
The rule that covers two transfers at once is isolation. At its strictest, running transactions concurrently must leave the database in the same state as if they had run one after another. Without it you can get problems such as a , where one reads a row that another has changed but not yet committed, and might yet cancel.
Theo Härder and Andreas Reuter coined the acronym in 1983, building on Jim Gray's earlier work. The idea was already running in IBM's IMS in 1973.
Quiz me
0/3
Recap
A transaction is all-or-nothing, valid, run as if one at a time, and permanent once committed.
💡 A trick to remember it · All or nothing, rules kept, one at a time, written in stone: A, C, I, D.
Surprising fact · IBM IMS had ACID transactions in 1973, ten years before the acronym was coined.
Connects to
- 📊 How did a 1970 paper about tables come to run the world's data?
- 🔥 How does a database survive a machine catching fire?
- 🧰 Why did Amazon and Google build databases without tables?
- 🔤 Why is a 50-year-old language still how we ask data questions?
- 🏃 Why did people queue outside a bank in 2007 to grab their own money?
Sources (3)
No source, no claim. Every fact in this lesson (13 claims) cites at least one of these.