Write-ahead log
A technique where changes are logged before being applied to disk, enabling recovery if the system crashes mid-transaction.
One of the foundational principles of ACID databases: before you modify a row, first write a log entry describing the change — both what it is (redo log, to replay the change) and what it was (undo log, to revert if needed). If the system crashes between logging and writing, the recovery process reads the log and either completes or rolls back the partial work.
Invented in the 1970s and mandatory in every modern DBMS, write-ahead logging is the reason your data survives power outages and hardware failures. Each transaction incurs at least two disk writes (log, then data), which is the price of durability and the reason modern databases are slow but reliable.