This project compares the performance of a NoSQL database (MongoDB) and an SQL database (MySQL) in terms of query speed, scalability, and data storage efficiency. The goal is to demonstrate how NoSQL databases handle unstructured data compared to relational databases.
With the rise of big data and unstructured datasets, NoSQL databases are increasingly being adopted for their flexibility and scalability. However, relational databases still dominate for structured data with well-defined relationships. This project aims to assess how these two types of databases perform for the same dataset in terms of insertion speed and query execution.
- Insert a dataset of 1 million records into both a MySQL database and a MongoDB collection.
- Execute basic queries on each database and measure execution time.
- Python 3.x
- MongoDB
- MySQL
pymongolibrary for MongoDBmysql-connectorfor MySQL
# MongoDB Performance Test
from pymongo import MongoClient
# MySQL Performance Test
import mysql.connector