Table of contents of the article:
In the digital age we live in, speed and responsiveness have become fundamental components for the success of any online project. Whether it is an institutional website, e-commerce or a content platform, performance is often the key to standing out from the competition and providing a superior user experience. This is especially true for CMS (Content Management Systems) such as WordPress, Joomla and Drupal, as well as e-commerce platforms such as WooCommerce, Magento and Prestashop, which require a robust and fast database to handle large volumes of data and real-time transactions .
Choosing the right database can be the difference between the success and failure of an online operation. In addition to ensuring high performance, it is also crucial to consider cost-efficiency, especially for startups and small businesses that have limited budgets. On the other hand, large enterprises are looking for scalable solutions that can grow with them, without compromising speed or security.
In this article, we propose a detailed and comparative analysis of three commonly used relational database management systems (RDBMS): MySQL, MariaDB and Amazon Aurora. The goal is to provide a clear picture of their performance, capabilities and economic efficiency. This will allow you to make a more informed decision, adapting the chosen solution to the specific needs of your project.
Through a series of tests, we will analyze various aspects that include processing speed, scalability and, of course, cost. These factors will be critical in determining which database system is best suited to support a high-performance web application, as might be required by a high-traffic WordPress site or complex web application.
MySQL: The Pioneer Who Standardized Databases
MySQL is one of the oldest and most widespread relational database management systems in the web world. Initially developed by MySQL AB in 1995, the software has undergone numerous evolutions over the years. One of the most significant turning points was its acquisition by Sun Microsystems in 2008 and subsequently by Oracle in 2010. While these acquisitions led to technological advancements and greater integration with other Oracle products, they also raised several issues. Criticisms focused, for example, on code shutdowns and dismissals, which eroded the open source nature of the project. Despite this, MySQL continues to be a mainstay in the database world, used by web giants like Facebook and YouTube.
MariaDB: The Ideological Revolution
MariaDB was conceived as a fork of MySQL in 2009, primarily as a reaction to Oracle's marketing and licensing policies. Essentially, it represents a sort of “ideological” evolution of the original project, with a focus on a more open and community development environment. MariaDB also introduces a number of technical improvements over MySQL, including greater efficiency and additional features. These advantages have helped make it an increasingly popular choice among developers looking for a robust alternative to MySQL, without compromising compatibility.
Aurora AWS: The Power of the Cloud at the Service of Databases
Amazon Aurora is a managed relational database service that offers compatibility with both MySQL and PostgreSQL. This database engine combines the speed and robustness of high-performance commercial systems with the flexibility and accessibility of open source databases. Basically, all the code, tools, and applications you're already using with MySQL or PostgreSQL can be easily integrated with Aurora. In some cases, Aurora can provide throughput that is up to five times higher than MySQL and three times higher than PostgreSQL, without requiring substantial changes to existing applications.
In addition to these features, Aurora stands out for its high-performance storage system, optimized to work in synergy with its database engines. This fast, distributed storage is designed to automatically adapt to your scaling needs, with a cluster volume that can span up to 128 tebibytes (TiB). Aurora also automates and standardizes database clustering and replication procedures, which typically require significant configuration and management effort.
Finally, it is important to note that Amazon Aurora is a component of the broader Amazon Relational Database Service (Amazon RDS). Amazon RDS is a web platform that facilitates the creation, maintenance, and scaling of relational databases in the context of cloud computing.
However, it is important to note that these benefits come with a price. Aurora can be an expensive solution, especially for smaller companies or for projects with limited budgets, making the cost factor a decisive element in the choice to adopt it or not.
Test Methodology: Comparison between MySQL, MariaDB and Aurora on an RDS t4g.medium instance
AWS RDS (Amazon Web Services Relational Database Service) offers the ability to deploy a managed and optimized database in the cloud. AWS engineers have done an excellent job of optimizing each instance type for the amount of RAM and CPU cores provided. This pre-configuration by a team of experts allows us to compare the relative performance of database engines, rather than our ability to optimize a given database system.
First Phase of the Comparison
The first part of this comparison involves spinning each database on a db.t4g.medium RDS instance and running a test with HammerDB, a very popular database benchmarking tool. Next, we'll explore smaller and larger instances to see which database scales best.
The Infrastructure Used
All databases in this part of the comparison were run on a db.t4g.medium instance equipped with 2 ARM CPU cores and 4 GB of RAM. The default settings included encryption at rest and no performance insights or advanced monitoring features.
- Version: Aurora MySQL 3.01.1 (Compatible with MySQL 8.0.23)
- Configuration: Single master, no replication
- Estimated cost (may vary depending on usage): $100 per month
- Version: MySQL 8.0.27
- Storage: 100GB with GP2 storage
- Configuration: No standby
- Estimated cost: $65,86 per month
- Version: MariaDB 10.5.13
- Storage: 100GB with GP2 storage
- Configuration: No standby
- Estimated cost: $65,86 per month
- HammerDB extension
- Version: HammerDB 4.3 Linux
- Operating system: Ubuntu 20.04
- Instance type: EC2 t3.medium
- Placement: In the same Availability Zone as the RDS instances to minimize latency.
- Connection: Through VNC to a Gnome UI to launch tests and take screenshots.
Execution of the Test
We started the transaction counter and started testing.
MySQL on RDS t4.g medium instance
Right out of the box, MySQL immediately recorded around 50.000 transactions per minute, maintaining this level throughout the test. The CPU usage report shown on the AWS dashboard indicated that MySQL used approximately 90% of its available CPU cycles. This is a clear sign that the workload is limited by CPU rather than memory, suggesting that the performance bottleneck lies in the computing power and not the memory capacity of the instance.
MariaDB on RDS db.t4g.medium instance
The official HammerDB profile on Github recommends using the MySQL driver to run benchmarks on MariaDB, although there is a specific driver for MariaDB. Therefore, we will keep all settings for MariaDB unchanged, except for the new hostname and credentials.
MariaDB quickly demonstrates that, with this instance size, its performance is superior. As soon as the test starts, we notice a speed increase, suggesting that MariaDB is better optimized for instances of this size than MySQL.
One thing that surprised me was that the speed continued to rise. During the test, it regularly reached almost 80,000 transactions per minute! This suggests that MariaDB not only starts with high performance, but is also capable of maintaining and increasing this level of efficiency throughout the entire test cycle.
Aurora on RDS db.t4g.medium instance
We were very excited to see what Aurora could do in this test. Amazon makes a lot of claims about its speed; for example, Aurora's FAQ page claims it is up to five times faster than MySQL.
However, this benchmark shows that Aurora was approximately as fast as MySQL for this specific workload. Despite the high expectations fueled by Amazon's claims, actual performance did not show a significant speed advantage over MySQL in the context of this test.
Aurora seemed to show slightly lower CPU usage than the others.
We also checked how much I/O Aurora uses during testing, as many people on the Internet complain about I/O being unexpectedly expensive. Our test peaked at 300 IOPS per second.
In the end, the expected bill for this unit running on AWS EU-WEST-2 was around $100 per month.
Analysis of Performance Benchmark Results
- MySQL: Recorded 16,855 orders processed per minute and 50,945 transactions per minute.
- MariaDB: With 23,347 orders and 76,866 transactions per minute, it performed significantly better.
- Aurora: It totaled 15,781 orders and 47,517 transactions per minute.
Detailed Performance Analysis
MariaDB surpassed both its competitors, MySQL and Aurora, both in terms of orders and transactions processed per minute. This data is particularly surprising for Aurora, which, despite Amazon's claims of superior performance, has shown no significant advantage over MySQL.
Cost Efficiency Comparison: Orders Processed per Dollar Spent
In order to provide a more complete and holistic analysis, we also evaluated the cost efficiency for each database. We used benchmark data and estimated monthly costs to calculate the number of orders processed per dollar spent:
- Aurora: 6,817,435 orders per dollar
- MySQL: 11,052,459 orders per dollar
- MariaDB: 15,309,508 orders per dollar
Based on this indicator, MariaDB was the most cost-efficient database, followed by MySQL and finally Aurora.
Conclusion: MariaDB As The Best Choice
If the goal is to maximize both performance and cost efficiency for a high-performance transactional database system, MariaDB appears to be the most advantageous choice. It outperformed both MySQL and Aurora in both aspects in our test.
While MySQL remains a solid option for those who are already well integrated into that ecosystem, if cost efficiency is a concern, it may be prudent to consider a move to MariaDB. Aurora, while boasting a number of advanced features, doesn't seem to justify the higher price, at least for workloads similar to those under our test.
In a business context where every millisecond and every cent has a significant impact, especially for those focused on web performance as in our case, it is essential to make well-informed decisions. We trust this article will provide you with the tools you need to do so.