Write-Ahead Logging
(Redirected from write-ahead logging)
Jump to navigation
Jump to search
A Write-Ahead Logging is a database recovery technique that records database changes to a log file before applying them to database files to ensure transaction durability and crash recovery.
- AKA: WAL, Transaction Log, Recovery Log.
- Context:
- It can typically record Transaction Changes in sequential order.
- It can typically ensure ACID Properties through log persistence.
- It can typically enable Point-in-Time Recovery via log replay.
- It can typically support Database Replication through log streaming.
- It can typically maintain Checkpoints for recovery optimization.
- ...
- It can often implement Log Archiving for long-term retention.
- It can often compress Log Records for storage efficiency.
- It can often support Parallel Recovery through log segmentation.
- It can often enable Hot Backups without database locks.
- ...
- It can range from being a Physical Write-Ahead Logging to being a Logical Write-Ahead Logging, depending on its log record format.
- It can range from being a Synchronous Write-Ahead Logging to being an Asynchronous Write-Ahead Logging, depending on its write timing.
- ...
- It can be implemented by PostgreSQL WAL, MySQL InnoDB Log, Oracle Redo Log.
- It can integrate with Streaming Replication for high availability.
- It can support Database Clusters through distributed logging.
- ...
- Example(s):
- Database-Specific WAL Implementations, such as:
- PostgreSQL WAL implementing WAL segment files.
- MySQL Binary Log for replication support.
- Oracle Redo Log with archived log mode.
- WAL Operation Modes, such as:
- WAL Usage Patterns, such as:
- ...
- Database-Specific WAL Implementations, such as:
- Counter-Example(s):
- Shadow Paging, which creates page copies rather than logging change records.
- In-Memory Database, which may not require persistent logging.
- Append-Only Storage, which achieves durability without separate log files.
- See: Database Recovery, ACID Transaction, Database Replication, Checkpoint (Database).