Transaction Log
A log file where the database records every change before writing to disk, enabling recovery from failures.
Before a database actually updates a table, it writes an entry to the transaction log saying "I'm about to do X". If the system crashes mid-operation, the database can read the log on restart and complete or roll back the operation depending on its status. This technique underlies ACID guarantees — particularly durability (D), which ensures data doesn't disappear after a crash.
WAL (Write-Ahead Logging) is standard in modern databases like PostgreSQL, MySQL, SQLite, and RocksDB. The log can also serve replication — by shipping log entries to a standby server, you create an exact copy of the primary. Without a transaction log, any power failure could permanently corrupt the database.