Storage layout considerations
The following storage layout best practices are recommended:
- To benefit from Power Flex snapshots to create database copies that can be, all the database data files and write-ahead logs (WAL) need to be included in the same snapshot operation. Therefore, the database should reside on Power Flex volumes, and these volumes include as a unit in each such snapshot operation. If the snapshot is needed, the volumes are mounted to a host and the PostgreSQL database services is started. As Power Flex snapshots are consistent, PostgreSQL will simply start the database copy with the data showing all the committed transactions up to the point of the snapshot creation time.
- To benefit from Power Flex snapshots to create valid PostgreSQL database backups, it is important to not only place the database data files and WAL on Power Flex volumes, but also to separate them to different volumes. When the database files and WAL are on separate Power Flex volumes, if the WAL survived the event that caused the need for database recovery, we can restore just the data files volumes without overwriting the WAL data which includes the latest transaction records. This will enable a full database recovery of all committed transactions.
- A solution that allows the Power Flex snapshots to serve both as a backup image as well as a point-in-copy image is when the snapshot creation always include both data files and WAL volumes. In a recovery scenario, just the data volumes can be restored, and if a point-in-time copy of the database is desired, both the WAL and data files volumes can be restored. Remember that to create valid backups, PostgreSQL APIs need to be invoked, as described in the backup use case earlier.