NEW
Also known as: Write-Ahead Log, WAL, Redo Log, Commit Log
An append-only record of database changes used to ensure durability, support recovery, and enable replication.
DESCRIPTION
A transaction log records all modifications in an append-only sequence before applying them to data files, enabling crash recovery and maintaining ACID durability. Checkpoints periodically persist state to reduce recovery time. Logs feed replication and change data capture by streaming committed changes to followers or downstream systems. Implementations include write-ahead logging, redo logs, and logical binlogs. Proper sizing, archiving, and monitoring of log throughput are critical to performance and data safety.
ALTERNATIVE DEFINITIONS
PostgreSQL Documentation
Write-Ahead Logging (WAL) is a standard method for ensuring data integrity. The idea is that changes to data files must be written to a log before the corresponding data files are updated.
Emphasizes the ordering guarantee central to WAL for integrity.
Microsoft Learn
The transaction log records all transactions and the database modifications made by each transaction.
Defines scope: all transactions and their data changes.
MySQL Reference Manual
The binary log contains events that describe database changes such as table creation operations or changes to table data.
Frames the log as an event stream useful for replication and recovery.
RELATED TERMS
ACID Two-Phase Commit Crash Recovery Checkpointing Replication Change Data Capture Logical Decoding Event Sourcing
COMPETING TERMS
Shadow Paging
RELATIONS
- Narrower: Append-Only Log
KNOWLEDGE AREAS
Data Storage & Operations Data Engineering Software Engineering Real-time & Streaming Data
TARGET AUDIENCE
Data Engineer Data Architect DevOps Engineer Cloud Architect Software Developer
EXTERNAL SOURCES
- Wikipedia - Transaction log
- PostgreSQL - Comprehensive WAL design and operations.
- Microsoft - SQL Server transaction log concepts.
- MySQL - Binary log for replication overview.
TOP QUESTIONS
What is a Transaction Log and why is it important?
It is an append-only record of all changes, guaranteeing durability and enabling crash recovery. It also underpins replication and change data capture pipelines.
Category: Definition
How does Write-Ahead Logging relate to Transaction Logs?
WAL requires writing log records before data files, ensuring recoverability. It is the most common mechanism to implement durable transaction logs.
Category: Theory
What are common mistakes managing Transaction Logs?
Letting logs grow without backups, undersizing storage for log throughput, and not monitoring replication lag can cause outages and data loss risks.
Category: Mistakes
How do Transaction Logs support replication?
Logs stream committed changes to replicas, which apply events in order. Logical decoding formats enable selective downstream processing.
Category: Implementation
What is the risk of filling up the Transaction Log?
Databases can halt writes, backups fail, and recovery windows extend. Proactive truncation, backups, and storage headroom are essential.
Category: Risk
Is the Transaction Log the same as CDC?
CDC often reads from the transaction log to extract changes, but CDC is a downstream consumption pattern, not the log itself.
Category: Misunderstanding
How do checkpoints interact with Transaction Logs?
Checkpoints flush dirty pages to disk, reducing future recovery work. They don’t eliminate the log but bound the amount to replay after crashes.
Category: Management
What is a hot topic around Transaction Logs?
Low-latency log shipping and cloud-native log storage tiering improve recovery time objectives and reduce costs.
Category: Topic
What is an alternative to Transaction Logs for durability?
Shadow paging avoids in-place updates, but it is less common in modern general-purpose databases compared to WAL.
Category: Alternatives