<img height="1" width="1" style="display:none;" alt="" src="https://dc.ads.linkedin.com/collect/?pid=254577&amp;fmt=gif">

Migrating to Amazon RDS Aurora

In the first place we used MariaDB 10 for main persistent storage. It is not just a drop-in replacement for MySQL but also provides better performance through the XtraDB engine so we didn’t have any performance issues. However we did face some problems regarding service that we thought would be solved if we moved to Aurora.

* Aurora is also a drop-in replacement of MySQL with better performance and many extra features such as backup and failover.

오로라1

Problems we faced

1. Backup

We did a daily backup and uploaded the backup to S3 but it was getting bigger and slower as our service grew.

2. Replica

It took days to restore the data to a replica and make it sync between them so we couldn’t use an up-to-date replicated db for deployment test purposes.

3. Failover

Master-Replica configuration requires an engineer’s intervention from failure to promoting replica to a new master. An engineer must watch over the entire process and operate all steps manually.

4. Scalability

You must choose a higher tier of instance to reduce service downtime for the future as the service grows which means you cannot leverage the advantage of cloud based on-demand scaling feature.

Problems solved with Aurora

1. Backup

Amazon RDS provides automatic backup which create a snapshot from the current volume and you can also create new DB instances from snapshots with one click.

오로라2

2. Replica

You can make a replica with one click within 10 minutes which provides less than 10ms replication lag and works perfectly out of the box.

오로라3

3. Failover

오로라4

There are two types of instance in the Aurora cluster: primary and replica. Replicas can be promoted to primary instances with one click. The domain name is changed automatically to the promoted primary instance so you don’t have to change all the service settings. The DNS cache time may need adjustment to prevent Java connecting to the wrong primary with a cached DNS value. [http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.MultiAZ.html]

4. Scalability

Aurora automatically grows storage as needed, from 10GB up to 64TB. You can also change instance class any time you want and with the failover feature you will only experience a very short downtime to scale your Aurora instance.

Migrating to Aurora with minimum downtime

오로라5

After we have decided to migrate to Aurora we need to find a way to do it with minimum downtime. Aurora, drop-in replacement of MySQL, could work as a MySQL replica and with that feature we could transfer all data from MariaDB to Aurora then promote Aurora to be the new master for our service.

Here is our migration scenario:

  • Create the Aurora instance
  • Set Aurora as a replica of MariaDB
  • Wait until the replication process is complete.
  • Shutdown the service and promote the Aurora to be Master
  • Restart the service with the new configuration to the Aurora instance

It only requires a very short downtime as described above between service shutdown and restarting with the new configuration.

[http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.NonRDSRepl.html]

오로라6

After migration to Aurora

We should solve the following problems using Aurora’s features.

  • We can create a fully working DB instance with up-to-date production data for temporary usage and it should save a lot of time when setting up a deployment testing environment.
  • We can achieve high availability using the one click failover feature.
  • We can merge all metrics of Aurora with our system dashboard using the CloudWatch API.
  • We can select the right instance size without considering the future.

However, there are also some new problems we might face with Aurora.

  • The maximum number of connection depends on the size of ram so it should be increased to support a high number of concurrent clients.
  • CPU usage is 2~3 times higher than before. We still don't know if this problem is only for Aurora or has arisen over all RDS.
  • There is an extra cost for I/O and storage. It might be very costly especially when all data is sent to Aurora. [https://aws.amazon.com/rds/aurora/pricing/]

 


 What is Aurora?

Amazon Aurora is a MySQL-compatible, relational database engine that combines the speed and availability of high-end commercial databases with the simplicity and cost-effectiveness of open source databases. [https://aws.amazon.com/rds/aurora/faqs/]

SendBird?

SendBird provides the chat API and SDK for your app enabling real-time communication among your users. We provide everything from UI, chat API, SDK, to backend that enables messaging experience in minutes.

Written by

TAGS aurora db, aws aurora, Engineering, maria db, rds, Recent Posts, SendBird

Subscribe to Email Updates

Recent Posts