Performance comparison of distributed MySQL andMongoDB in a cloud environment

University essay from Blekinge Tekniska Högskola/Institutionen för programvaruteknik

Author: Viktor Ljungdahl; [2023]

Keywords: ;

Abstract: Context: Comparing MongoDB and MySQL performance in the cloud is useful for developerswhen deciding which database to use based on cost, performance, workload size, and composition.As cloud computing becomes more popular, developers must consider the scalability, availability,and ease of use of these platforms when selecting a database. Evaluating the performance ofMongoDB and MySQL in the cloud can help developers determine the best database for theirneeds and workloads. Objectives: The objectives of this study included examining AWS, MySQL, MongoDB, databasemetrics, and MongoDB Atlas. To compare the performance of MySQL and MongoDB databaseclusters on an EC2 instance within a VPC, a controlled experiment was conducted using YCSB.The runtime and latency of both databases were analyzed as performance metrics. Methods: To understand cloud computing, AWS, MongoDB, MongoDB Atlas, MySQL, YCSB,and design an experiment addressing the research questions, a literature review was conducted. Acontrolled experiment was then conducted to compare the performance of MongoDB and AWSusing YCSB on an EC2 instance, with various workload sizes ranging from 100 to 100,000 andcompositions of CRUD requests. The latency and runtime for each test were analyzed to evaluatethe performance of MongoDB and MySQL. Results: The comparison showed that MySQL performed better than MongoDB for smallerworkloads, but MongoDB outperformed MySQL as the workload increased in size. Previousresearch also found that MongoDB tends to perform better for larger workloads. The results alsoindicated that when deployed in a MongoDB Atlas cluster, MongoDB has high latency forworkloads ranging in size from 1 to 100. Another finding was that using database cluster replicassignificantly improved read operations for both databases. Conclusions: This research compared the performance of MongoDB and MySQL in a cloudenvironment, using pre-defined workloads with varying CRUD compositions and sizes. The mainmetrics were latency and runtime. Methods used to achieve the result was an initial literature studyfollowed by a controlled experiment. Results showed that MySQL performed better with smallerworkloads and MongoDB performed better with larger workloads. Read replicas also had asignificant impact on performance for both databases. These findings suggest that developersshould consider workload size and composition, as well as scaling capacity and the availability ofread replicas, when choosing a database for a cloud-based application 

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)