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 条评论
登录 后参与评论

相关文章

来自专栏小怪聊职场

大数据|zookeeper简介及3个简单易懂的案例分析(一)

2715
来自专栏F-Stack的专栏

F-Stack Q&A 第三期

Q1:如果在一个阻塞型的socket上执行recv,会不会把相应的线程卡死,调用recv时该socket中没有数据包,导致sleep,sleep导致该线程没办法...

4278
来自专栏编程一生

干货 | 云智慧透视宝Java代码性能监控实现原理

1382
来自专栏SAP最佳业务实践

SAP最佳业务实践:无变式配置按订单生产(148)-4分组件的零件生产

image.png 1、分组件的库存采购 在实际业务情况中,原材料通常从外部供应商处购得(可包括在标准采购处理中)。 半成品S224包含原材料R124。 您可...

2658
来自专栏KaliArch

记一次混合监控的反思

作为最底层的技术人员,目前由于有客户在运维中遇到混合架构,公有云上使用了产品级别Redis数据库,同时由于业务在云服务器和kubnets的容器内也有redis数...

1025
来自专栏散尽浮华

zabbix监控-基本原理介绍

一、Linux下开源监控系统简单介绍 1)cacti:存储数据能力强,报警性能差 2)nagios:报警性能差,存储数据仅有简单的一段可以判断是否在合理范围内的...

3379
来自专栏恰同学骚年

NoSQL初探之人人都爱Redis:(1)Redis简介与简单安装

  随着互联网Web2.0网站的兴起,传统的关系数据库在应付Web2.0网站,特别是超大规模和高并发的SNS类型的Web2.0纯动态网站已经显得力不从心,暴露了...

752
来自专栏数据和云

RAC一个节点自动重启问题分析

题记:在RAC数据库的故障当中,节点重启的现象很常见,在这种问题的处理当中,有一定的规律性。为了更好的说明这个问题的处理过程,保证出现该类问题的时候,能够有序的...

3225
来自专栏猛牛哥的博客

集结号抢座挂的制作分析过程(一):座位内存的分析

2196
来自专栏北京马哥教育

深入浅出分布式文件系统MogileFS集群

一、简介 MogileFS是一款开源的分布式文件存储系统,由LiveJournal旗下的Danga Interactive公司开发。 Danga团队开发了包括...

3596

扫码关注云+社区