ACID in Plain Words
The bracket you used in the last topic comes with guarantees, and the guarantees have a famous name: ACID. It's an acronym (Atomicity, Consistency, Isolation, Durability), and it sounds like an exam topic, which is a shame, because underneath it are four plain promises: all-or-nothing, rules-always-hold, no-elbowing, and committed-means-committed.
This page adds no new machinery. Everything ACID names, you watched happen in Topic 30; the four letters are just the vocabulary that lets you talk about it with anyone in the field. Learn them here, in Marquee terms, and every future conversation about databases, including every NoSQL pitch you will ever hear, assumes exactly this page.
One picture holds all four promises: a wedding ceremony. A wedding either completes or it doesn't; nobody is half-married (that's atomicity). It cannot end with the paperwork invalid; if the license fails, the marriage doesn't happen (consistency). Two ceremonies running in the same venue don't mix guests mid-vow (isolation). And once the register is signed, it's signed; the couple doesn't become unmarried when the lights go out (durability). That's the whole acronym. Now let's pin each promise to the exact moment it acted in Anna's booking, and use the real terms from here on.
Here is Topic 30's bracket again, unchanged, with each promise pinned to the line where it does its work:
BEGIN; -- Isolation: nobody else sees inside INSERT INTO bookings (customer_id, screening_id, seat) VALUES (214, 88, 'G7'); -- Consistency: every rule still checked INSERT INTO bookings (customer_id, screening_id, seat) VALUES (214, 88, 'G8'); -- Atomicity: G7 + G8 are one unit COMMIT; -- Durability: from here, crash-proof
A Is for Atomicity
Atomicity is the bracket itself: the transaction is one indivisible thing. "Atom" is old Greek for "uncuttable", and that is precisely the claim — no power cut, crash, or mid-bracket error can cut the transaction into a done half and an undone half. Both of Anna's seats, or neither. Topic 30 was one long story about atomicity; now it has its name.
Notice what atomicity does not promise: it doesn't say the transaction will succeed. It says the failure will be clean. A rolled-back bracket leaves the database exactly as it was before BEGIN, which is why failure stopped being scary one topic ago.
C Is for Consistency
Consistency says the declared rules hold through the transaction. Every constraint the Marquee declared in Chapter 6 (NOT NULL, UNIQUE, the foreign keys that must point at real rows) is still enforced when statements arrive inside a bracket. A transaction cannot end with the rules broken: the door policy from Chapter 5's INSERT page works at the bracket's door too.
One honest limit, because it trips up professionals: consistency means the declared rules hold, not that the data is true. If Lora types the wrong price and every constraint passes, the database is perfectly consistent and perfectly wrong. The database enforces rules; truth remains your job.
I Is for Isolation
Isolation is the crowd promise: transactions running at the same moment don't see each other's half-done work. While Anna's bracket is open, no other customer's query, no report, and no refund ever sees a world where G7 is booked and G8 is not. They see the Marquee as it was before her transaction or as it is after it commits — never mid-bracket.
How isolated, exactly? That turns out to be a dial rather than a switch, and it is the whole story of the next page, including what happens when two people want the very same seat in the very same second.
D Is for Durability
Durability picks up where COMMIT ends: once the database confirms a commit, a crash or power cut loses nothing. Here is the simplified one-sentence version of how — before touching the real tables, the database writes every change to a journal on disk, so after a crash it can replay anything it already promised. That picture is simplified on purpose; the full mechanism belongs to a deep-dive course. The promise is what matters at this altitude.
Durability is also the most commonly over-trusted letter. It protects committed work against crashes, and nothing else. It will preserve your committed mistakes with the same faithfulness as your committed bookings, and it lives on the same disk as everything it protects. What covers the disasters beyond a crash is Topic 33's subject: backups.
- "ACID is a feature checkbox some databases have." It's four separate promises, and real systems keep them to different degrees — isolation especially, as the next page shows. Chapter 10's NoSQL families trade some of them away on purpose. The acronym is a conversation, not a badge.
- "Consistency means the data is correct." It means the declared rules hold. A wrong price that passes every constraint is consistent and still wrong; the database enforces rules, not truth.
- "Durability means backups." Durability survives a crash; backups survive a fire and a committed mistake. Different disasters, different tools — Topic 33 draws the full map.
- "Atomicity guarantees my transaction will succeed." It guarantees the failure will be clean: a bracket that can't complete rolls back whole, leaving the database exactly as it was.
- ACID is the four-word vocabulary of every serious data conversation, including every NoSQL tradeoff pitch you will ever hear; after this page, those conversations are open to you.
- Knowing which promise does what tells you which failure story you're in — and which tool (ROLLBACK, a constraint, a backup) is the right response.
Knowledge Check
"The whole bracket succeeds or fails as one indivisible unit." Which letter of ACID is that?
- Atomicity
- Consistency
- Isolation
- Durability
Lora commits a transaction where a ticket price was typed wrong, but every constraint passed. What does the consistency promise say about this?
- Consistency was violated, so the database should have refused the COMMIT
- The promise was kept: consistency covers declared rules, not truth
- Consistency only applies to multi-statement transactions, so it wasn't involved
- The database will detect the wrong price later and roll the transaction back
Which disaster does durability, on its own, protect against?
- A fire that destroys the machine the database runs on
- A WHERE-less UPDATE that was committed by accident
- A power cut moments after the database confirmed a COMMIT
- Two customers booking the very same seat at the very same moment
While Anna's transaction is still open, what does another customer's query see?
- Whatever Anna has done so far, including G7 booked but G8 still pending
- The Marquee before her bracket, or after it commits — never mid-bracket
- Nothing at all: the database refuses all queries until her transaction ends
- A warning message saying that a transaction is currently in progress
You got correct