Migrate MySQL 5.5 to AWS

0

A customer is running ~60 MySQL databases (the majority are 5.5, the rest are 5.6) on-prem and are using GCP for DR/backup site (they do not perform local backups in their DC). Their database vary in size and can reach up to 3 TB. The way they sync the data with the DR site is by backing up the databases on-prem using Percona XtraBackup, copy the backup files to the cloud and import into the databases in the cloud from these backup files. They then use statement based replication (SBR) for updating the DR site continuously. Same mechanism is used to migrate data back to their data center when they need to recover a database from backup or when they will need to fail back after a DR. To perform backups, they just create volume snapshots at different intervals on the cloud (hourly for the first day, daily for the fist week, weekly for the first month and then monthly for 6 months).

They want to migrate the DR/backup site to AWS. They could use a similar approach and use MySQL on EC2, but there is not much benefit for them in this, so they are willing to move only if they can use managed services (Aurora MySQL, RDS MySQL). I need to come with a solution that will address their requirements:

  • Use Percona XtraBackup and not mysqldump due to the format of the files and the time it takes to seed a database from dump files
  • Continuous replication (to achieve near zero RPO), using statement based replication
  • Ability to move back to on-prem in short time when needed
  • Use managed services

If I understand correctly, they can use the same mechanism for 5.6 using Aurora. They can import into an Aurora cluster from XtraBackup files and then they can set up SBR from on-prem to AWS. However, this solution does not solve the other direction. They can't backup Aurora (or RDS) using XtraBackup. This means that they will either need to use mysqldump, which they don't want to use as they claim it takes way too long. As an alternative they can create a MySQL Instance as a replica of Aurora and then use it to create the backup.

Q1: Are there any other options to achieve what they need?

Q2: How long should it take to create an Aurora replica on EC2 from a large database?

Q3: Can the same mechanism be used to migrate from 5.5 on prem to Aurora 5.6? (and vice versa)

Q4: Assuming that the answer to Q3 is yes, how backwards compatible is 5.6? Will the applications that use 5.5 work against 5.6 or will they need to be rewritten?

Assuming there are issues with replicating from 5.5 to 5.6, they will need to use RDS MySQL 5.5 on AWS. My understand is that 5.5 does not support importing XtraBackup files.

Q5: Is there a way to use XtraBackup with 5.5?

If the answer to Q5 is no, they could use mysqldump or DMS to replicate from on-prem to the cloud. The initial seeding will be slower than XtraBackup if I understand correctly.

Q6: Is there a preferred solution for the initial seeding? DMS? mysqldump, mydumper, etc.? Can they use SBR after the initial seeding?

Q7: How to move back the data from RDS 5.5?

Q8: I guess what I am asking is: What is the best solution for them for 5.5 (and maybe also 5.6)?

1 Answer
0
Accepted Answer

Perhaps our easiest solution is to use AWS Database Migration Service - not to "migrate" but as a low-cost continuous replicator. DMS allows heterogenous replication, so both 5.5 and 5.6 MySQL instances can be replicated to Aurora MySQL 5.6 (or 5.7).

MySQL 5.6 is backwards compatible with 5.5 except for a few configuration changes. See https://dev.mysql.com/doc/refman/5.6/en/upgrading-from-previous-series.html for the exact details.

DMS will cover all of the use cases you describe. The Aurora copy of the database will get every transaction a few seconds after the on-premises transaction is committed.

For initial load, it might make sense to use Snowball, then let DMS synchronize any changes.

Let me know if you need further details!

answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions