A write-ahead log (WAL) is one of those database concepts that sounds deceptively simple. You write a record to disk before applying it to your in-memory state. If you crash, you replay the log and recover. Done.
Except your disk is lying to you.
PostgreSQL, SQLite, RocksDB, Cassandra… every production
Read in full here: