Amazon Aurora is a fully-managed, MySQL-compatible relational database engine designed for the AWS cloud.
It’s architected to scale with your applications, combining the availability and speed of high-end commercial platforms with the cost-effectiveness and simplicity of open source databases. Maximizing that scale and performance starts with a successful, well-executed migration employing the right approaches, tools, and expertise.
1. Determine Which Databases You’re Connected To
To determine which database (DB) instance in an Aurora DB cluster a connection is connected to, you need to check the innodb_read_only global variable.
It will be turned off when you’re connected to the primary resource. This can help you add logic to your application and balance the workload or be sure a write operation makes use of the correct connection.
2. Scale Reads for a MySQL Database with Amazon Aurora
Using Amazon Aurora with MySQL DB instances lets you take advantage of Aurora’s built-in read scaling capabilities while expanding the read workload for your MySQL DB instances. To use Aurora for read scaling, you need to create an Amazon Aurora DB cluster before making it a replication slave of your MySQL BD instance. Keep in mind that this applies to Amazon RDS MySQL DB instances or MySQL databases that run external to RDS.
When setting up replication between MySQL and Aurora DB instances, remember to adhere to these guidelines:
- Use an Aurora DB cluster endpoint address when referencing your DB cluster. In the event of a failover, the replica promoted as the DB cluster’s primary instance will keep using that endpoint address.
- Maintain all binlogs on your master instance until verifying they’ve been applied to the replica. This helps to make sure you’ll be able to restore the master instance if there’s a failure.
Keep in mind that:
- Permissions needed to start a replication are restricted, meaning they won’t be available to the Amazon RDS master user. To set up a replication between an Aurora DB cluster and a MySQL DB instance, you need to use these commands: rds_set_external_master and mysql.rds_start_replication.
- A known issue when an Aurora DB cluster is in the replication slave is that it might pause without warning. As a result, the CloudWatch ReplicaLog will keep growing. If this happens, you need to restore the cluster from its most recent snapshot and set up a replication of the restored cluster as the new replication slave.
3. Use Aurora for Disaster Recovery (DR) with MySQL Databases
Using Aurora with a MySQL DB instance lets you create off-site DR backup and recovery. To use Aurora for DR, you need to create an Amazon Aurora DB cluster before making it a replication slave of your MySQL DB instance. Remember that this applies to Amazon RDS MySQL DB instances or MySQL databases that run external to RDS.
Keep in mind that:
- When setting up a replication between MySQL DB instances and an Aurora DB cluster, the replication isn’t managed by RDS. You need to proactively monitor it to make sure it stays healthy and make repairs as necessary.
To learn how to create an Aurora DB cluster and turn it into a replication slave of your MySQL DB instance, follow the guidelines provided in “Using Amazon Aurora to Scale Reads for Your MySQL Database.”
4. Migrate From MySQL to Aurora with Minimal Downtime
When it comes time to import data from a MySQL database supporting a live application to an Aurora DB cluster, follow the procedures outlined in “Importing Data to an Amazon RDS MySQL or MariaDB DB Instance with Reduced Downtime.” This will cut down on the amount of time your data will be interrupted while migrating to Aurora, which can be especially helpful when working with large databases.
Remember that you can use an Aurora DB cluster for the target RDS MySQL DB instance, as Aurora is compatible with MySQL.
An agile, scalable, and secure experience on the AWS cloud starts with a successful migration. That means using the right tools and working with experienced AWS experts to deliver the best results.
At iTMethods, our AWS experts will architect and manage your journey to the cloud – working with you to create and execute a roadmap tailored to your needs. Contact us to speak with a cloud expert today!
- Must-Read Best Practices for Migrating to Amazon Aurora - August 23, 2016
- 6 Dos and Don’ts of Disaster Recovery in AWS - July 29, 2016