5.6 Differences Between DBMSs and a One-Line Summary

All major DBMSs follow the WAL principle. What differs between them is the name and organization of the log.

ItemPostgreSQLMySQL (InnoDB)OracleSQL Server / Azure SQL
Name of the logWALRedo LogRedo Log (online redo log)Transaction Log
Where Undo information livesNo pre-change values in WAL. The old row version itself stays in the table (Chapter 7)Separate Undo log areaSeparate Undo tablespacePre- and post-change values together in the Transaction Log
Torn page countermeasurefull page writedoublewrite bufferBlock checksum + restore from backupPage checksum (CHECKSUM) + restore from backup
Log file structureFixed-size segment files used one after anotherA few fixed-size files used in a circleCircular by group, can be archivedOne log file used in a circle by virtual log unit

Learn more — PostgreSQL WAL, InnoDB Redo log, Oracle Redo log, SQL Server transaction log, VACUUM, InnoDB Undo log, Oracle Undo, full_page_writes, InnoDB doublewrite buffer, PAGE_VERIFY

Table 5-1. Log organization and terminology by DBMS

NOTE Organization and terminology may differ by version. In particular, InnoDB's redo log structure has changed across versions.

The names differ for historical reasons. Oracle and MySQL call it Redo Log, meaning "the log for doing it again"; SQL Server calls it Transaction Log, meaning the record of transactions; and PostgreSQL takes the name of the principle itself and calls it WAL. The terminology mapping table in the appendix summarizes this in one line.

Where Undo information is kept connects directly to Chapter 7. PostgreSQL does not record pre-change values separately in the log. As seen in Section 1.4, the previous version of a row stays as-is inside the table page, and that serves as the Undo information. InnoDB and Oracle keep previous versions in a separate Undo area, and this area is used for both rollback and concurrent reads (Chapter 7). Each product meets the same requirement of "reversal" in a different place.

TIP One-line summary. Because a data page can end up half written, the database writes changes sequentially to the log before the data pages, and treats the moment the log is on disk as the commit. This one rule secures both atomicity (the material to reverse) and durability (the material to redo), and pushes expensive random writes off the commit path.

Connection to later chapters. This log does not end with crash recovery. Chapter 10 looks closely at what a single log record looks like and at the recovery procedure, and then confirms that backup (Chapter 11), CDC (Chapter 12), and read replicas (Chapter 13) are all features that keep, interpret, and replay this log. Much of what a database does is, in the end, an answer to "where else should this log be written?"