Write-Ahead Logging (WAL)

Difficulty: Advanced

Question

How does WAL ensure durability?

Answer

By logging every change to a persistent file (the log) BEFORE the changes are applied to the actual data files. If the system crashes, the log is used to replay the changes.

Concepts covered

Durability, Recovery