Introduction
Recently, we got into a project where our client was interested in implementing the application with a multi-model Database called Arango DB that could be easily built in any relational database. This triggered us to carry out a comparison between MySQL and Arango DB. So, here we go!
Overview of ArangoDB
ArangoDB is a multi-model, distributed, open-source database with flexible data models for documents, graphs, and key-values. High-performance applications can be built using a convenient SQL-like query language or JavaScript extensions. It can be scaled horizontally or vertically.
MySQL
MySQL is an open-source relational database management system (RDBMS). It delivers a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.
Arango vs MySQL: Performance Benchmarking
Configurations:
We used the following configurations to carry out the performance test.
- For Test 1, we spawned 4 VMs in Azure each having 2 Cores, 4 GB RAM, 4 GB Disk.
- VM1 — Hosted ArangoDB and MySQL over Docker.
- VM 2 — Hosted our Pizza Delivery Spring boot application with 2048 memory and pool size 20.
- VM3 & VM4– Used to execute Artillery Test.
- For Test 2, we spawned 2 VMs in Azure each having 4 Cores, 8 GB RAM, 8 GB Disk.
- VM1 — Hosted ArangoDB and MySQL over Docker.
- VM 2 — Hosted our Pizza Delivery Spring boot application with 2048 memory and pool size 20.
- We used 2 VMs from Talentica Network TestBox1, TestBox2 and my Laptop was used as TestBox3– Used to execute Artillery Test.
- Both Arango and MySQL were loaded with 50000+ Records/documents.
- Each Record or document was of size 10KB.
- Spring boot applications were configured to fetch Top 50 orders of a given City.
- We used artillery to load test our applications and had set a timeout of 120 seconds for each scenario to be tested.
- To load the test, we used 3 boxes, 2 Azure VMs, and a Laptop. Arrival rate distribution is mentioned in the Data Table under the “Machine wise Arrival rate column.
Test Cases:
Tests for the following scenarios were carried out for both ArangoDB and MySQL:
- Create Order
- Find an Order by Order ID
- Find Top 50 Orders by City
Test Set:
Test1:
- MySQL DB had joined. Order Details table joined with Pizza Table whereas ArangoDB stored data in a nested structure.
- The test was conducted with 50K data.
- Tests were conducted with 2 Cores, 4 GB RAM, 4 GB Disk configuration
Test 2:
- ArangoDB and MySQL used a flat table structure.
- The test was conducted with 100K data.
- Tests were conducted with 4 Cores, 8 GB RAM, 8 GB Disk configuration.
Test Results:
After executing the above test cases, the results were recorded in terms of Latency (ms), DB and Application CPU and Memory Utilization(%), Success Rate. The recorded data is as follows:
- Latency is in milliseconds
- CPU and Memory Utilization is in %
Test 1
Test 2
Latency
Test 1
Test 2
CPU and Memory Utilization for ArangoDB and MySQL
Test 1
Test 2
Success Rate for ArangoDB vs MySQL
Test 1
Test 2
Analysis
Performance
-
- Read Queries
While conducting this exercise, we found that the Response time for read queries is the same for both ArangoDB and MySQL databases (even taking latency into account). This is derived after studying the results of Fetch/Find one.
- Write Queries
While conducting this exercise, it was observed that ArangoDB performed way better than MySQL DB in terms of write operations. ArangoDB can provide an edge in the case of Write heavy Applications and Bulk Reads where the size of data per document/record is high as compared to MySQL.
- Success Rate
ArangoDB is better in terms of success response within the given time of 120 seconds. Success response of MySQL DB improved on using the flat structure.
When to choose MySQL
Though Arango DB seems to be faster than MySQL in various tests conducted, MySQL has an edge over reliability, stability, and ease of data export & import. It is good as a DB for mission-critical applications and suitable for dealing with core/financial data.
When to choose ArangoDB
ArangoDB is a good choice for applications that need frequent fetching of bulk details and write-heavy applications. We also observed that the ArangoDB application needed more restarts than the MySQL application.
In short, both ArangoDB and MySQL perform almost the same in terms of Read operation. ArangoDB is better than MySQL in terms of write operations.
Pros and Cons/Limitations
Feature Comparison
Conclusion
After testing our application with both ArangoDB and MySQL we found ArangoDB is faster in case of write and bulk reads. MySQL has a good position from the stability point of view and community support as compared to ArangoDB. ArangoDB will be suitable for applications who need Graph DB and faster response and needs to deal with data loads. However, MySQL is well suited for application that deal with monitory details need to support transactions like Banking.
GitHub Details For ArangoDB and MySQL Spring Boot Projects
https://github.com/priyakartalentica/ArangoDBvsMySQLBenchmarking.git