Transactions and the ACID Promise
A transaction groups statements so they take effect together or not at all, keep the database's rules true, do not see each other half-done, and survive a crash once committed. Those four promises are what let application code stay simple.
What a learner can do afterwards
- State each of the four properties in terms of what a failure would otherwise leave behind
- Identify a sequence of statements that has to be one transaction
- Explain what rollback restores and what it cannot undo
1 · Read
A transaction is a bundle of steps the database runs together. Atomicity means all or nothing: either every step happens or none do, so money never leaves one account without arriving in the other.
Consistency means each transaction moves the database from one valid state to another, never breaking rules like a balance never dropping below zero. Isolation means concurrent transactions never see each other half done, as if each ran alone.
Durability means committed work survives even a crash right after, because the database keeps a log it can replay. Rollback is the undo button for a transaction that cannot finish: it wipes partial steps and restores the last valid state. It cannot reach work already committed, like a confirmation message already sent.
Group statements that must stand together into one transaction, such as debit plus credit in a transfer. The database then handles the hard parts: no partial updates, no broken rules, no mixed overlaps, and no lost work.
Bundle related steps, and atomicity, consistency, isolation, and durability cover the failures for you.
2 · Watch
Take it off screen
Where it sits
8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.