Aws ec2 mysql vs rds_MySQL 实例迁移至 AWS: RDS vs EC2

题记:当将MySQL实例移动到AWS时,你可能需要选择使用 RDS还是 EC2。 本文将重点介绍一些需要考虑的关键因素,以帮助您确定哪种是服务您的数据的最具成本效益的解决方案。

When moving your MySQL instances to AWS, you would probably have to deal with this decision. This article will highlight some of the key factors that need to be considered in order to help you determine which is the most cost-effective solution for serving your data.

当将MySQL实例移动到AWS时,你可能需要选择使用 RDS还是 EC2。 本文将重点介绍一些需要考虑的关键因素,以帮助您确定哪种是服务您的数据的最具成本效益的解决方案。简介

RDS is based on EC2, so in this post I will focus on the benefits and disadvantages of using the former, versus migrating MySQL into user-managed EC2 instances.

RDS是基于EC2的,因此在本文中,我将重点介绍使用RDS的优缺点,与将MySQL迁移到用户管理的EC2实例做对比。

The value of RDS resides in simplified provisioning and administration. Several of the most common maintenance tasks such as minor version upgrades, backups, and slave creation are automated and can be managed from the AWS console. On the other hand, RDS imposes some limitations to MySQL functionality so it could be offered “as a Service” while delivering a safe and consistent user experience.

RDS的价值在于简化供应和管理。 一些最常见的维护任务(例如小版本升级,备份和从属创建)是自动的,可以从AWS控制台进行管理。 另一方面,RDS对MySQL功能增加了一些限制,可以以服务的方式进行提供,同时保障安全和用户体验一致性。

Within those limitations we can mention

这些限制包括:Storage engine support(存储引擎支持)

Plugin-related  features(插件相关功能)

Tools or operations requiring SUPER privilege(需要SUPER权限的工具或操作)

Replication  (topologies, filters, etc)(复制(拓扑,过滤器等))

Failover(故障转移)

Lack of  access to the underlying operating system(缺乏对底层操作系统的访问)MySQL RDS pros and cons in bullets

MySQL RDS的主要优点:1. Instance provisioning time is within the range of minutes

实例配置时间在分钟范围内

2. Instance type supporting the database server can be easily scaled up and down

支持数据库服务器的实例类型可以轻松地放大和缩小

3. Storage and IOPS can be scaled up easily

存储和IOPS可以轻松扩展

4. Replicas can be provisioned/destroyed automatically and within minutes

副本可以在短时间内自动提供/销毁

5. Backups, snapshots and restores (including PITR) processes are greatly simplified and are fully automated

备份,快照和恢复(包括PITR)进程大大简化,实现完全自动化

6. Backups and minor version upgrades are done with minimal impact to production if using Multi-AZ instances.

如果使用多可用区实例,进行备份和小版本升级几乎不会对生产产生影响

7. Multi-AZ instances implements synchronous standbys replicas on a different AZ for failover and backups

多可用区实例在不同的AZ上实现同步备用副本,用于故障转移和备份

8. Read replicas on different AWS regions can be easily deployed for load balance and Disaster Recovery purposes

可以轻松部署不同AWS区域上的只读副本,以实现负载平衡和灾难恢复缺点和限制1.Once storage is allocated for the instance, it cannot be reclaimed without rebuilding the instance from a logical restore.

为实例分配存储后,如果不从逻辑恢复重建实例,则无法回收。

2.Access to the operating system is denied, so any operation that requires OS-level access cannot be performed. Many tasks can be run from an external EC2 instance, but not all.

拒绝对操作系统的访问,因此无法执行需要操作系统级访问的任何操作。尽管许多任务可以从外部EC2实例运行,但并不是全部。

3.Access to MySQL user accounts with ‘SUPER’ privilege is denied. Tasks such as configuring replication that require SUPER are handled through RDS stored routines. Configuring dynamic and non-dynamic MySQL variables are handled through RDS parameter groups.

不允许访问具有“SUPER”权限的MySQL用户帐户,如配置需要SUPER的复制的任务通过RDS存储例程来处理。配置动态和非动态MySQL变量是通过RDS参数组处理的。

4.Storage engines other than InnoDB are permitted but not supported and consistent backups / restores are not guaranteed.

允许但不推荐除InnoDB以外的存储引擎,并且不能保证一致的备份/恢复。

5. Read and standby replicas are implemented separately: standby replicas are synchronous but are not accessible for reading while read replicas are asynchronous and even they can be used for failover, they rely on MySQL asynchronous replication and data may be lost in the process. Due to this separation, it is additional cost to get full DR and read-scaling capabilities.

只读副本和备份副本分开实现:备份副本是同步的,但不能访问读取,而只读副本是异步的,甚至可以用于故障转移,它们依赖MySQL异步复制,数据可能会在进程中丢失。由于这种分离,获得完整的DR和读取扩展能力是额外的成本。成本评估

A quick estimation comparing RDS and EC2 for similar instances and storage shows that RDS is between 40 and 68% more expensive than EC2:

通过相似的实例和存储来比较,对RDS和EC2的简单评估显示RDS比EC2贵40至68%:

## MySQL on EC2-Instances:3 x m2.4xlarge

-Storage:3 1Tb EBS volumes (provisioned IOPS – 3000 IOPS) + 100Gb/month of snapshots space

-Intra-Region Data Transfer: 40Gb/Month

On-demand instances USD $3465 per month

Reserved instances (1 year, partial upfront) USD $1490 per month

## MySQL RDS-Instance type: 1 x db.m2.4xlarge

-Multi-AZ:yes

-Storage:1Tb (provisioned IOPS – 3072 IOPS)

-Backup space:100Gb/month

-Intra-Region Data Transfer: 40Gb/Month

On-demand instances USD $6557 per month

Reserved instances (1 year, partial upfront) USD $2930 per month

The above costswere estimated using AWS simple monthly calculator

上述的成本评估是基于AWS的每月计算总结

There is no right or wrong decision when choosing which AWS solution is better for MySQL.

选择哪个AWS解决方案更适合MySQL时,没有正确或错误的决定。

RDS is a powerful option if your data is already in InnoDB(and only in InnoDB) and you are looking for a simple, low-maintenancedeployment. When other engines and more complex topologies come into the scene,or even the need for MySQL plugins, then going to EC2 is a better option.

当数据已经在InnoDB中(并且仅在InnoDB中),如果你正在寻找一个简单,低维护的部署,则RDS是不错的选择。如果涉及到其他引擎和更复杂的拓扑,甚至需要MySQL插件,那么此时选择EC2会更好。

Anycritical process or script running locally on a MySQL instance could also bethe decisive factor for choosing EC2, usually because of the time spent inmoving the data through the network. Finally, the cost is definitely a keyfactor, especially when moving several instances into RDS.

在MySQL实例上本地运行的任何关键进程或脚本都可能是选择EC2的决定性因素,通常是因为花费在通过网络移动数据的时间。 最后,成本绝对是一个关键因素,特别是当将几个实例移入RDS时。

如何加入"云和恩墨大讲堂"微信群

你可能感兴趣的:(Aws,ec2,mysql,vs,rds)