I have a postgresql database on amazon EC2 and you need to determine the best way to back up this data. I am considering two options:
(1) Install the EBS volume in a directory, such as / pgsqldata, and use this directory as the postgresql data directory (on Amazon Linux, / var / lib / pgsql / data / is used by default). Then this volume will receive frequent snapshots.
or
(2) Store the postgresql data directory in it by default. Then use pg_dump to often delete backups to a place like / pgsqldumps, and this volume will get a snapshot after each pg_dump.
The third option is just a snapshot of the volume of the root device (I use an instance with EBS support), since in my case it is both a web server and a database. I like the idea of having a dedicated volume for data backup.
Finally, if I take direct snapshots in the real postgresql data directory, do I need to worry about possible changes to the database during the snapshot process?
thank
source
share