What are the respective advantages/limitations of

2020-02-16 05:15发布

I realize a couple of basic differences between the two, i.e.

  1. EC2 is going to be cheaper

  2. RDS I wouldn't have to do maintenance

Other than those two, are there any advantages to running my database from RDS as opposed to a separate EC2 server acting as a MySQL server. Assuming similar instance sizes, are both going to run into the same limitations in terms of being able to handle a load?

To give you a little bit more info about my use, I've got a database, nothing too big or anything (biggest table 1 million rows), just high SELECT volume.

8条回答
干净又极端
2楼-- · 2020-02-16 05:52

RDS is not really a high availability system. Read the fine print in the RDS faq. During a failover event it can take up to 3 minutes to failover. Additional amazon will decide it needs to "upgrade" your rds instance and do a failover at that point which will take your database down for "up to 3 minutes" (our experience is that it can take a longer than that).

RDS high availability is very different than master - master or master - slave replication and is much slower. They don't use mysql replication but uses some kind of ebs replication. So in a failover situation it will mount the ebs on the backup machine, start mysql, wait for mysql to do failure recover (hopefully nothing got corrupted too bad), then do a dns switch.

I hope this helps you with you evaluation.

查看更多
女痞
3楼-- · 2020-02-16 06:04

This is a simple question with a very complicated answer!

In short: EC2 will provide maximum performance if you go with a RAID0 EBS. Doing RAID0 EBS requires a pretty significant amount of maintenance overhead, for example:

http://alestic.com/2009/06/ec2-ebs-raid

http://alestic.com/2009/09/ec2-consistent-snapshot

EC2 without RAID0 EBS will provide crappy I/O performance, thus it's not even really an option.

RDS will provide very good (though not maximum) performance out of the box. The management console is fantastic and it's easy to upgrade instances. High availability and read only slaves are a click away. It's REALLY awesome.

Short answer: Go with RDS. Still on the fence? Go with RDS!!! if you enjoy headaches and tuning every last little bit for maximum performance, then you can consider EC2 + EBS RAID 0. Vanilla EC2 is a terrible option for MySQL hosting.

查看更多
SAY GOODBYE
4楼-- · 2020-02-16 06:04

In this post there is an excellent benchmark between:

  • Running MySql on a Small EC2 + EBS
  • Running MySql on a Small EC2 + EBS + adjusted MySql parameters
  • A Small RDS

The benchmark is very good since it is not focused only in ideal conditions (only one thread) but also in more realistic scenarios, with 50 threads hitting the database.

查看更多
该账号已被封号
5楼-- · 2020-02-16 06:04

I had the same question this weekend. There is a 4 hour downtime window per week for RDS where they do maintenance. RDS seemed more expensive if you can get away with a micro instance of EC2. (This is true of test instances which has minimum traffic) I also wasn't able to change the timezone of the RDS instance because I dont have permission.

I am now actually looking at http://xeround.com/ which is mysql on EC2 by another company. They do not use InnoDB, instead they have their own engine called IDG. I am just starting to investigate that but they are in BETA and will give 500MB of space.

查看更多
干净又极端
6楼-- · 2020-02-16 06:09

Regarding the maintenance window question. If you use Multi-AZ then RDS will create a standby replica in another availability zone so that there's no down time for maintenance and you protect yourself against a zone failure.

That's what I'm planning to do in the next week or so. Of course it's going to cost you more but I haven't worked that bit out yet.

查看更多
对你真心纯属浪费
7楼-- · 2020-02-16 06:10

MySQL on EC2 vs RDS MySQL

Advantages of MySQL on EC2 Amazon EC2 Inter Region Replication

Copy Snapshots across Amazon EC2 regions

RAID 0 with EBS Striping in MySQL EC2

More than 3TB of Disk space ( You will not need this for your size) can be attached on MySQL on EC2.

Disadvantages of MySQL on EC2

Configuration, Monitoring and Maintenance compared to RDS

Point in time backups available in RDS

IOPS lesser than RDS MySQL ( even after RAID 0) currently, 10800 with 6 disks for MySQL on EC2 whereas 12500 IOPS 16KB on RDS MySQL

查看更多
登录 后发表回答