Databases · interactive
The write-ahead log
A transaction moves $50 from A to B and commits. Then the power goes out before the changed pages reach disk. Does the money survive? The rule: write what you're about to do to a log first.
Memory (buffer pool)
A=100 · B=0
Write-ahead log
- empty
Data files on disk
A=100 · B=0
money on disk: 100
A has 100, B has 0, on disk and in memory.
Database
Step 1 of 4 · read left to right
In production
Tools and technologies
Every durable database writes a log before data pages.
Not tied to one language — use these names when you search docs or design a system.