Greetings everyone!!!!!
Let’s begin the phase II of our blog on Aurora serverless-V2.
Part 1 – https://www.mydbops.com/blog/exploring-aurora-serverless-v2-for-mysql/
Here, I have focused primarily on the migration strategies, hence this blog will be helpful for those who are in a stance to migrate towards serverless V2.
Before entering into the migration strategies, let’s take a look at the feature called “Mixed-Configuration”. and then discuss about the migration strategies
- Mixed-Configuration:
- AWS RDS(MySQL) to ServerlessV2
- Test Environment :
- Self-Managed MySQL to ServerlessV2
- Physical Backup Method:
- Logical Backup Method:
Mixed-Configuration:
Aurora serverless V2 supports a mixed configuration ie., you can have your provisioned Aurora as a replica for Aurora serverless V2 and vice versa. This is possible since they can share the same underlying cluster volume.
We will briefly discuss the below migration paths.
- AWS RDS to ServerlessV2
- Self-managed MySQL to ServerlessV2
AWS RDS(MySQL) to ServerlessV2
Migrating from RDS (MySQL) to Serverless is simplified with the advantage that RDS supports creating Aurora read replica(provisioned). From this created Aurora read replica, we can proceed provisioning of Aurora Serverless V2 by “Mixed Configuration” support.
Test Environment :
Server Type: t3.medium
Disk : 30GB
MySQL Version : 8.0.23
Creating Aurora-replica(provisioned):
Select the corresponding RDS and then click on to Actions —> Create Aurora Replica.
Now make changes according to your preference such as the replica instance name, PG group etc and then click “create read replica” at the bottom.
Aurora replica cluster creation starts and also it starts migrating the data from RDS to Aurora storage , this can take quite some time depending on your data footprint.
It took me around 10 mins as its a test migration and data size was very small
Now the replica cluster is available and data is in sync
Creating serverlessV2 replica:
Select our Aurora cluster Actions —-> Add reader.
Under “Instance configuration” choose “DB instance class” as “serverless V2” as below
If you are having multiple reader in your cluster choose “Failover Priority” to tier 0 or 1, to have precedence in the aurora fail-over process
Make other changes according to your preference and click “create read replica” at the bottom, we can see the serverlessV2 being created and available currently as a replica as shown below
Cut-over:
Now we are at the final phase , wherein we need to induce a fail-over within the aurora cluster to promote our serverless instance to become primary ie., writer.
The fail-over was pretty quick and took 37 secs for my test migration
My cluster looks as below with serverless being my primary instance.
Last step is to promote our replica cluster and point application. Cluster promotion would take around 10 to 15 mins.
Self-Managed MySQL to ServerlessV2
Self managed MySQL refers to installation done in VM’s/physical server either in Public or Private DC , When you plan to migrate you can consider the below two methods
- Physical Backup method
- Logical Backup Method
Physical Backup Method:
In Physical Backup Method we will use Xtrabackup for migration, this method is recommended for dataset more than a TB. We have already covered the step by step procedure in our previous blog. Pls note that source backup should be taken on the supported RDS MySQL version, refer here. Incase if source server version is lagging behind with minor patch, pls apply them and then proceed for migration to Severless-V2 with xtrabackup
Logical Backup Method:
Logical Backup Method uses any of the logical backup tools such as mysqldump, mysqlpump , Mydumper etc. This would usually be preferred when the data size is less than a TB. We have lot of blogs in Mydbops covering the logical migration strategies as below.
- Object Migration to RDS
- Mysqldump Vs Mysqlpump Vs Mydumper
- Streaming MySQL data with mydumper
- Faster logical backup with Mydumper
Just in-case if you are looking for a migration partner, our team can help you with end to end migration and modernization of MySQL database
In continuation we will see about Read-only scaling, parameter groups & cost performance with Aurora serverless V2 on our next blog.
Stay Tuned!!!!!!