Skip to main content

MongoDB vs MySQL

 

MongoDB and MySQL are two databases that are used by developers when implementing various enterprise applications.

Let's compare and contrast these two databases according to the following topics

  • What is MongoDB and MySQL?
  • Differences
  • Why Use ?
  • Disadvantages
  • When to Use?

What is MongoDB and MySQL?

MongoDB

MySQL

MongoDB is an open-source database developed by MongoDB, Inc.

MongoDB stores data in JSON-like documents that can vary in structure.

It is a popular NoSQL database.

MySQL is a popular open-source database developed, distributed and supported by Oracle Corporation.

It  relational database management system (RDBMS) that is developed, distributed and supported by Oracle Corporation








Differences

NoSQL vs SQL

NoSQL databse            

SQL database

No need predefined structure

Need predefined structure

 

Non-Relational Database

Relational Database

Data as of JSON documents

Represents data table and rows

Does not support JOIN                 

Supports JOIN

 

Query language - JavaScript

Structured Query Language


Differences in Terminology

MySQL

MongoDB

Table

Collection

Row

Document

Column

Field

Joins

Embedded Documents , Links


MongoDB vs MySQL

 Type

Mongo DB

MySQL

Data Storing

Each individual records are stored as ‘documents’.

Each individual records are stored as ‘rows’ in a table.

Hierarchical Upper Of A Record

Documents belonging to a particular class or group as stored in a ‘collection’.

A ‘table’ is used to store rows (records) of similar type.

Data Representation

MongoDB stores data in form of JSON-like documents.

 

 

MySQL stores data in form of rows of table

Join Supporting 

Doesn't support JOIN

 

Supports JOIN operations

 Shema Nature

Real-time analytics, content management, internet of things, mobile apps

Structured data with clear schema


Why Use?

MongoDB use because of 

  • Flexibility
  • Adaptable to real business world situations and requirements.
  • Supports field, range-based query, regular expression, etc. for searching the data from the stored data.
  • Very easy DBMS system that can easily scale up or down.
  • Helps you to uses internal memory for storing the working temporary datasets for which it is much faster.
  • offers primary and secondary indexes on any field.
  • Supports the replication of the database AND can provide high availability with replica sets
  • Offers various methods to perform aggregation operations on the data 
  • can run over multiple servers, balancing the load and/or duplicating data to keep the system up and running in case of hardware failure.

MySQL use because of

  • It supports Offload Reporting, Geographic Data Distribution, etc.
  • Supports features like Master-Slave Replication, Scale-Out
  • Support for memory storage engine for frequently used tables
  • Query Cache for repeatedly used statements
  • Easily learn and troubleshoot MySQL from different sources like blogs, white papers, and books.


When to use


MongoDB

MySQL

If you have unstructured or structured data with the potential of rapid growth

If you have structured

If most of your services are cloud based

If data need a traditional database




References :
  • https://www.geeksforgeeks.org/mongodb-vs-mysql/#:~:text=What%20are%20MongoDB%20and%20MySQL%3F&text=MongoDB%20is%20an%20open%2Dsource,that%20can%20vary%20in%20structure.&text=MySQL%20is%20a%20popular%20open,and%20supported%20by%20Oracle%20Corporation.
  • https://www.guru99.com/mongodb-vs-mysql.html#:~:text=KEY%20DIFFERENCES%3A,data%20in%20tables%20and%20rows.&text=MongoDB%20doesn't%20support%20JOIN,Structured%20Query%20Language%20(SQL).

Comments

Popular posts from this blog

Rest API

 What is REST? REST, or Representational State Transfer, is an architectural style for providing standards between computer systems on the web, making it easier for systems to communicate with each other. REST-compliant systems, often called Restful systems, are characterized by how they are stateless and separate the concerns of client and server. (Wikipedia) Restful Web Services  is a lightweight, maintainable, and scalable service that is built on the REST architecture. Restful Web Service, expose API from your application in a secure, uniform, stateless manner to the calling client. The calling client can perform predefined operations using the Restful service. The underlying protocol for REST is HTTP. REST stands for Representational State Transfer Difference between REST API s and Database People think REST API are Databases. My main purpose is to solve the conflict between this REST API and databases because when REST API are used by the developers , they treat REST A...

Version Control

  In  software engineering ,  version control  is a class of systems responsible for managing changes to  computer programs , documents, large web sites, or other collections of information. Version control is a component of  software configuration management .  [Wikipedia] Other names       –       Revision control , Source control , Source code management Version Control Systems  They are software tools that help software teams manage changes to source code over time. Version control software is an essential part of the every-day of the modern software team's professional practices. Using version control systems, several developers, designers, and team members will work on the same project. These systems, also known as version control systems or VCS, ensure that everybody has access to the most current code. Why Version Control system is so Important?      Groups of software developers ar...