Skip to content

This is a simple program written in Python that is meant for viewing easily, the performance of both Databases. The language displayed in the program is Spanish, but the whole code is in English, keep that in mind.

Notifications You must be signed in to change notification settings

Colima-97/MySQLvsMongo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MySQL vs MongoDB

This is a simple program written in Python that is meant for viewing easily, the performance of both Databases. The language displayed in the program is Spanish, but the whole code is in English, keep that in mind.


MySLQ

Requirements

You don't need XAMPP, the database is online.

You need to install PyMySQL by pip with pip install PyMySQL.

Features

Create tables

It creates three tables:

  • Alumno (Student)
  • Materia (Subject)
  • Calificaciones (Score)

Alumno (Student) table has this structure:

value type key
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY
nombre varchar(255) NOT NULL N/A

Materia (Subject) has this structure:

value type key
clave INT NOT NULL AUTO_INCREMENT PRIMARY KEY
nombre varchar(255) NOT NULL N/A

Calificaciones (Score) has this structure:

value type key
clave_Materia int NOT NULL FOREIGN KEY
id_Alumno int NOT NULL FOREIGN KEY
valor float NOT NULL N/A
Show data

It asks you for a number, and shows you that quantity of rows. Also tells you how many records has each table.

Insert data

As this program is just for checking performance, or for future comparison with MongoDB, the data will be automatically created, by random function. This is it for the three tables. You just need to introduce the number of records you want to store. ACID transactions are considered.

When storage in MySQL has begun, the program will create a .txt file, called 'timesMySQL.txt'. It saves the times when storing data begins, and when it ends.

Delete data

There are two ways data can be deleted:

  1. Delete just the data
  2. Delete data and tables

You cannot choose which record will be deleted, the whole data is deleted.

For obvious reasons, when the second option is chosen, you must re-create the tables, by using the feature Create tables.

Exit

This option cancels the execution of the program.


MongoDB

Requirements

Install MongoDB Comunity Edition.

Install MongoDB Compass.

For Python, install PyMongo by pip with pip install pymongo

Features

Apparently, it only inserts a lot of data.

With MongoDB Compass you can check the performance of the database and compare it with MySQL performance.

About

This is a simple program written in Python that is meant for viewing easily, the performance of both Databases. The language displayed in the program is Spanish, but the whole code is in English, keep that in mind.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages