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时。

原文发布于微信公众号 - 数据和云(OraNews)

原文发表时间:2017-01-23

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏大宽宽的碎碎念

数据库事务、隔离级别和锁ACID的真实含义隔离级别和并发控制MySQL和PostgreSQL对比如何写代码

49612
来自专栏文渊之博

史上最大的CPU Bug(幽灵和熔断的OS&SQLServer补丁)

背景 原文地址(http://www.cnblogs.com/wenBlog/p/8435229.html) 最近针对我们的处理器出现了一系列的严重的bug。这...

3335
来自专栏杨建荣的学习笔记

DBA和开发同事的一些代沟(五) (r7笔记第92天)

陆陆续续写了四篇和开发同事的代沟,从最开始的吐槽到后面的例行总结,整个过程也是总结经验,看似很小的问题对于DBA来说就是莫大的改进,或者在开发严重越不过去的坎儿...

37810
来自专栏匠心独运的博客

大型分布式业务平台数据库优化方法(下)

文章摘要:当单表数据达到千万以上时,通过加索引或者表分区优化提升的效果就比较有限了,应该如何应对呢???

1144
来自专栏数据和云

青铜到王者,看看你的MySQL数据库是什么段位,如何提升?

作者 | 张甦, 数据库领域的专家和知名人士、图书《MySQL王者晋级之路》作者,51CTO 专家博主。近10年互联网线上处理及培训经验,专注于 MySQL 数...

1564
来自专栏张戈的专栏

重置多说配置后的问题,这是不让我从良的节奏啊(附禁用谷歌在线字体的方法)!

本想今天发文从良,金盆洗手,从此不再折腾博客,安心写文章的。结果,发现多说又不能同步服务器评论到本地了!特么真是怕什么来什么啊!想来这金盆暂时用不着了。。。 想...

3965
来自专栏月色的自留地

RS232串口的Windows编程纪要

1974
来自专栏数据库新发现

Oracle云数据库初体验 之一 - 申请与介绍

关于Oracle云数据库(Oracle Cloud Database)的一些体验和分享,也可以参考以下链接:

7313
来自专栏MongoDB中文社区

9月.精华文章推荐

1.《GDPR: Impact to Your Data Management Landscape:Part 3 》

1102
来自专栏数据和云

备份,迁移和克隆Docker镜像

编辑手记:上周我们分享了在MAC上安装Docker并部署Oracle 12.2数据库环境,基于Docker构建测试环境,非常快速和简捷。只通过以下几个步骤即可快...

4664

扫码关注云+社区