What is Write-ahead logs (WAL)?

A type of logs used by storage engine to guarantee transaction ACID. For performance reason, whenever a transaction commits, the storage engine does not changes the data file directly, instead it persists the change by appending it to a log file and then signals the commit success. This process is called write-ahead because the actual change to the data file is batched at a later time, the storage engine just writes ahead to a log file to guarantee that the transaction data persists. If the database crashes in between, the recovery process will redo the changes recorded in the write-ahead logs to apply to the data file, that's why it's also known as redo logs. Another usage for WAL is for change-data-capture (CDC) since it already records all the data changes. e.g. PostgreSQL uses WAL for logical replication.

External reference

Database schema migration and version control, Database CI/CD, and DevOps for developers and DBAs

Bytebase is an open source, web-based database schema change and version control tool for teams. It offers a web-based collaboration workspace to help DBAs and Developers manage the lifecycle of application database schemas.

  • MySQL
  • PostgreSQL
  • Snowflake
  • Oracle
  • SQL Server
  • MongoDB
  • Redis
  • Redshift
  • ClickHouse
  • TiDB
  • OceanBase
  • Spanner
  • MariaDB
  • GitLab
  • GitHub
  • Bitbucket
  • Azure DevOps
  • Terraform


Subscribe to Newsletter

By subscribing, you agree with Bytebase's Terms of Service and Privacy Policy.