Write-Ahead Logging (WAL) is a rollback journal implementation.
This implementation writes change directly to the rollback journal whereas the traditional rollback journal writes changes to the original database.
This rollback journal implementation has become the more prominent one because it enables non-blocking read and write.
The WAL represents a ledger of the changes the database plans to make to the database file (tables, indexes,…)
After a crash (or not), when the daemon first starts up, the process compares:
to perform a sort of replication. It will:
The Write-Ahead log implements transactions atomicity by:
As the COMMIT occurs without writing to the original data file, Read and write can then occurs simultaneously. Ie:
This means that :