Picture a bank transfer: $500 moves from account A to account B. The database subtracts from A, then adds to B — two separate writes. If power dies between them, A is short $500 and B never received it. The money vanished.
That is the durability and atomicity problem. A transaction must either complete in full or leave no trace at all. The database needs a way to know, after any restart, which transactions finished and which were still in flight.
The answer that almost every production database uses today — PostgreSQL, MySQL/InnoDB, SQL Server, DB2 — is ARIES: Algorithms for Recovery and Isolation Exploiting Semantics, published by C. Mohan and colleagues at IBM Research in 1992. It solved crash recovery so thoroughly that its design has changed little in three decades.
ARIES rests on one non-negotiable rule and three recovery phases. The rule is Write-Ahead Logging (WAL): before any data page is written to disk, its log record must reach disk first. The phases are Analysis, Redo, and Undo — and together they restore the database to the exact state it would have been in if the crash had never happened.
Comments
Loading comments...