๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

Databases Advanced

What is Write-Ahead Log (WAL)?

A technique where changes are first written to a log before being applied to the database, ensuring crash recovery and data integrity.

Write-Ahead Logging is fundamental to database reliability. Before any data modification is written to the actual data files, it is first recorded in a sequential log. If the database crashes, it can replay the WAL to recover committed transactions and undo incomplete ones. PostgreSQL uses WAL extensively - it powers crash recovery, point-in-time recovery (PITR), streaming replication, and logical replication. WAL settings like wal_level, max_wal_size, and checkpoint_timeout directly impact performance and recovery capabilities.

Related Terms

Materialized View
A database object that stores the precomputed result of a query, offering faster reads at the cost of periodic refresh.
Index
A data structure that improves the speed of data retrieval operations on database tables at the cost of additional storage.
Trigger
A database object that automatically executes a specified function when certain events (INSERT, UPDATE, DELETE) occur on a table.
View
A virtual table defined by a SQL query that provides a simplified or restricted view of data from one or more tables.
JSONB
PostgreSQL's binary JSON data type that stores JSON documents with indexing, querying, and manipulation capabilities.
Data Warehouse
A centralized repository optimized for analytical queries that integrates data from multiple operational sources.
View All Databases Terms โ†’