Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSQL and Amazon EBS Snapshots?

I found this article explaining how to run MySQL on Amazon EC2. It talks about using XFS as the filesystem and then leveraging EBS snapshots to create backups of the data. Does anyone know if I can do something similar using PostgreSQL? Are there changes to the SQL commands to FLUSH and LOCK the tables? Thanks!

like image 887
Shadowman Avatar asked Jun 08 '10 14:06

Shadowman


People also ask

What is snapshot in PostgreSQL?

Originally implemented in version 9.2, snapshot exports allow multiple transactions to share identical views of the same database state.

Where are EBS snapshots most commonly stored?

Amazon EBS Snapshots are a convenient way to back up your EBS volumes. The snapshots are automatically saved to Amazon Simple Storage Service (Amazon S3) for long-term retention.

Does AWS support PostgreSQL?

AWS supports PostgreSQL through a fully managed database service with Amazon Relational Database Service (RDS). Amazon Aurora with PostgreSQL compatibility is also built using PostgreSQL.

Can EBS be used during snapshot?

Snapshots can be used to create a backup of critical workloads, such as a large database or a file system that spans across multiple EBS volumes. Multi-volume snapshots allow you to take exact point-in-time, data coordinated, and crash-consistent snapshots across multiple EBS volumes attached to an EC2 instance.


1 Answers

Yes, that should work fine. As long as your data (all tablespaces) and pg_xlog are on the same device, it should just work. No need for any flushes or locking.

like image 143
Magnus Hagander Avatar answered Oct 27 '22 12:10

Magnus Hagander