PostgreSQL Backups & Restores - ScaleGrid

preview_player
Показать описание
ScaleGrid provides multiple options to handle the backup and restore of your PostgreSQL cluster. On your cluster details page, click on the backup and restore icon to view all the different options.

The first option we’re going to talk about is backup. ScaleGrid provides essentially two types of backups, on-demand and scheduled backups.

On-demand backups are typically associated with an application event. For example, if you’re releasing a new version of your app and would like to take a backup of your cluster before you release.

Let’s enter a name for this backup, and you can also enter an optional comment.

ScaleGrid implements backups using disk snapshots. On AWS, we use EBS snapshots, and on Azure we use Azure snapshots.

Scheduled backups allow you to set up recurring backups for your PostgreSQL cluster. By default, this is enabled for all the clusters that are created. All clusters are set to backup once per day with 7 backup retained.

You can customize your schedule to backup anywhere from once every 4 hours to once per week, as well as how many backups you want to retain.

Once your backups are configured, restore is a one-click operation. Simply click Restore from the Backup dropdown menu, select your backup, and click to restore. Our system than handles all the work necessary to swap out the disks, ensure the primary-standby configuration is right, and the system comes back to running.

The next operation we’re going to talk about is peek at backup, which is a selective restore operation. This is useful when you want to access particular data in your backup, but do not necessarily want to restore your entire backup.

For example, say you dropped a table or deleted a bunch or rows by mistake. What you want to do is go back to your latest backup and recover this data, but not necessarily restore this data to your production cluster.

With peek at backup, you can select the backup that you would like to recover, enter a name, and click peek.

This creates a new standalone PostgreSQL load with this particular backup, which like any other normal PostgreSQL load, is unrelated to your production instance. So, once it’s up and running, you can access it, download the data you want, and then throw it away.

Another scenario where this is useful is for testing. A lot of our customers use peek at backup to create a copy of the production data, and they can test this production data with the new version of their application.

The last operation we’re going to talk about is deleting backups. This is useful for on-demand backups you no longer want to keep around. Simply click Delete Backups from the Backup downdown menu, select the backup you’d like to delete, and click delete.

That’s it for our PostgreSQL backup and restore options.

Рекомендации по теме