Securing the WAL stream

The primary mechanism that PostgreSQL uses to provide a data durability guarantee is through its Write Ahead Log (WAL). All transactional data is written to this location before ever being committed to database files. Once WAL files are no longer necessary for crash recovery, PostgreSQL will either delete or archive them. For the purposes of a highly available server, we recommend that you keep these important files as long as possible. There are several reasons for this; they are as follows:

  • Archived WAL files can be used for Point In Time Recovery (PITR)
  • If you are using streaming replication, interrupted streams can be re-established by applying WAL files until the replica has caught up
  • WAL files can be reused to service ...

Get PostgreSQL 9 High Availability Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.