🎁 New User? Get 20% off your first purchase with code NEWUSER20 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

ETL (Extract, Transform, Load)
A data pipeline process that extracts data from sources, transforms it into a suitable format, and loads it into a destination system.
Window Function
An SQL function that performs calculations across a set of rows related to the current row without collapsing the result set.
Materialized View
A database object that stores the precomputed result of a query, offering faster reads at the cost of periodic refresh.
Vacuum
A PostgreSQL maintenance operation that reclaims storage from dead tuples and updates statistics for the query planner.
View
A virtual table defined by a SQL query that provides a simplified or restricted view of data from one or more tables.
Row-Level Security (RLS)
A database feature that restricts which rows a user can access in a table based on security policies.
View All Databases Terms →