简体   繁体   中英

AWS EBS Volumes and PostgreSQL

I have a couple of questions that I hope someone will help with:

  1. Can I use an EC2 instance (EBS backed) to load and run PostgreSQL DB?
  2. Can I create Read Replicas for my source DB on PostgreSQL?
  3. Can the Read Replica be created on the same EBS volume which houses the source DB or do I need to create the read replica on a seperate EBS volume.
  1. Yes. An EC2 instance is a general purpose computer running an x64 or x86 operating system, usually Linux or Windows, so you can run Pg on it.

  2. Again, yes. An EC2 is no different to any other server in this regard, you can use any of the supported replication options including streaming replication.

  3. Absolutely not, because PostgreSQL does not support shared-storage clustering. You must have independent storage for the read replica, using streaming replication. This is true on EC2 and everywhere else. In any case, AWS doesn't support attaching a single EC2 volume simultaneously to multiple hosts, you'd have to share it via something like drbd even if PostgreSQL did support shared storage - which it doesn't.

Where EC2 does start to differ is in performance. EC2's database performance has been .... erratic ... in my experience. Unless you use provisioned iops, in which case it's mediocre to good, but extremely expensive for what you get compared to real hardware. A cheap bottom of the line server with a decent SSD will thrash an expensive EC2 instance up down and sideways on most PostgreSQL workloads.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM