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.
Problems we faced
We did a daily backup and uploaded the backup to S3 but it was getting bigger and slower as our service grew.
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.
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.
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
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.
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.
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]
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
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.
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 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.