Bobcares

AWS Aurora MariaDB | All About

by | Aug 6, 2022

AWS Aurora-MariaDB, this combination allows us to focus on what matters to the organization’s business, such as optimizing database design, capacity sizing, and performance tuning. As a part of our AWS Support Services, Bobcares offers solutions to every query that comes our way.

AWS Aurora-MariaDB

AWS Aurora: The Amazon Relational Database Service includes Amazon Aurora, a fully managed relational database that is compatible with MySQL and PostgreSQL (Amazon RDS). To mainly concentrate on application development, Amazon Aurora offers continuous monitoring, self-healing storage, and automated scaling.

MariaDB: A compatible drop-in replacement for the widely used MySQL database technology is MariaDB, an open source relational database management system (DBMS).

In this article, we outline three distinct migration strategies from self-managed MariaDB to Amazon Aurora MySQL, each of which has a unique downtime profile. These techniques can also be used to switch from Percona MySQL and self-managed MySQL databases to Aurora MySQL. Let’s see the three methods in detail.

Migration Using AWS DMS

We can quickly and securely migrate databases to AWS with the help of the AWS Database Migration Service (AWS DMS). Follow these steps to implement this migration strategy.

  1. Firstly, Start the server with the --log-bin[=name] option to enable binary logs on the source MariaDB database.
  2. Then to connect the AWS DMS replication instance to the on-premises MariaDB database and the Aurora MySQL cluster, create an AWS DMS replication instance, and source and target endpoints.
  3. Run mysqldump with the --no-data flag set on the source database to export only the table definitions.
  4. Now import these table definitions to Aurora MySQL.
  5. Create and launch an AWS DMS task to replicate current changes and migrate existing data.
  6. When the replication lag is zero, stop the transactions on the source database and keep an eye on the replication lag on the AWS DMS replication instance.
  7. Finally, switch the application over to the Aurora MySQL cluster.

Single Threaded Migration Using mysqldump

The mysqldump is easy to use and it is single threaded. It creates logical backups of MariaDB and MySQL. Data definition language (DDL), data control language (DCL), and data manipulation language (DML) statements are contained in the dumps in the form of SQL files created by this tool.

Consider the following example. Here mysqldump runs on a client to export data from an external database and then pipes the dump into the mysql client utility, which loads the data into the Aurora MySQL database.

mysqldump -u local_user \
    --databases database_name \
    --single-transaction \
    --compress \
    --order-by-primary  \
    -plocal_password | mysql -u RDS_user \
        --port=port_number \
        --host=host_name \
        -pRDS_password

Multi-Threaded Migration Using mydumper

The mydumper is suitable for large databases. mydumper supports backing up the database using multiple parallel threads, up to one thread per available CPU core, making it faster than mysqldump. Let’s see the following example.

mydumper -h host_name \
    -u local_user \
    -p local_password \
    -t number_of_threads \
    -B database_name \
    -o export_file_location

myloader -h rds_host_name \
    -u RDS_user \
    -p RDS_password \ 
    -t number_of_threads \
    -B database_name \
    -d export_file_location

[Looking for a solution to another query? We are available 24/7.]

Conclusion

To conclude, our Support team showed us three different migration approaches to migrate a self-managed MariaDB/MySQL database to Aurora MySQL. This includes AWS DMS, mysqldump, and mydumper.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

2 Comments

  1. Rob Guida

    We tried to migrate from MariaDB to Aurora/MySQL, but some of our queries stressed the database to the point we had to rollback.

    Have you or anyone experienced this?

    Reply
    • Hiba Razak

      Hi,
      Our Experts can help you with the issue, we’ll be happy to talk to you on chat (click on the icon at right-bottom).

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.