[00:01] you respond? We'll start with the problem. So, you're moving $500 between bank accounts. You subtract from Alice's account, and you add to Bob's. You would run those two rights one after another, but your server crashes in between. Now, [00:14] Alice is down $500, and there's no record of where it went. The money just vanished, and your database has no idea that anything is wrong. This is why transactions exist. You wrap both rights in a single transaction, and the [00:27] database will treat them as a single atomic unit. Meaning either both happen, between. But, the real answer your interviewer wants is how, and the mechanism is what's called a write-ahead log, or WAL. Before the database touches [00:40] any data on disk, it writes the intended changes to this log first. Then, if the server crashes mid-transaction, the database uses that log on restart, flushed to disk yet, and undoing work from transactions that never committed. [00:54] The data on disk is never left half-written. Learn more at half-written. Learn more at hellointerview.com.