Differences between MongoDB and MySQL on various parameters are discussed below:
What are 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 relational database management system (RDBMS) that is developed, distributed and supported by Oracle Corporation. |
How Data is Stored?
MongoDB |
MySQL |
In MongoDB, each individual records are stored as ‘documents’. |
In MySQL, each individual records are stored as ‘rows’ in a table. |
HIERARCHICAL UPPER OF A RECORD
MongoDB |
MySQL |
Documents belonging to a particular class or group as
stored in a ‘collection’.
Example: collection of users. |
A ‘table’ is used to store rows (records) of similar type. |
SQL or NoSQL
MongoDB |
MySQL |
MongoDB is what is called a NoSQL database. This means that pre-defined structure for the incoming data can be defined and adhered to but also, if required different documents in a collection can have different structures. It has a dynamic schema. |
MySQL as the name suggests uses Structured Query Language (SQL) for database access. The schema can not be changed. The inputs following the given schema are only entered. |
Example: In a table, if there are columns for name, address and there is need to enter ‘age’ in new column in one of the entries, it will not take it as the column is not defined in schema.
This can be achieved in MongoDB, any new field can be inserted irrespective of the schema and is thus known to have dynamic schema.
SALIENT FEATURES
MongoDB |
MySQL |
MongoDB was designed with high availability and scalability in mind, and includes out-of-the-box replication and sharding. |
MySQL concept does not allow efficient replication and sharding but in MySQL one can access associated data using joins which minimizes duplication. |

Mongodb MySQL feature comparison gfg
Differences in Terminology
There are differences based on terminology between MongoDB and MySQL.

Terminology Differences gfg
Data Representation
The difference between the way data is represented and stored in both the databases is quite different.
MongoDB stores data in form of JSON-like documents and MySQL stores data in form of rows of table as mentioned earlier.
Example: To show how data is stored and represented in MongoDB and MySQL.

Data Representation MongoDB vs MySQL gfg
Unlock the Power of Placement Preparation!
Feeling lost in OS, DBMS, CN, SQL, and DSA chaos? Our
Complete Interview Preparation Course is the ultimate guide to conquer placements. Trusted by over 100,000+ geeks, this course is your roadmap to interview triumph.
Ready to dive in? Explore our Free Demo Content and join our
Complete Interview Preparation course.
Last Updated :
17 Apr, 2018
Like Article
Save Article