What are the differences between MySql and MongoDb?


MySQL is an open- source relational database management (RDBMS). It is owned and developed by Oracle Corporation which has source code and is available under the terms of the General Public License and also under a variety of patented contracts. It’s firstly introduced in 1995 which is under the GNU GPL License.

MySQL gained popularity in the web application world due to its LAMP. LAMP (Linux-Apache-MySQL-PHP) is a software stack which can be found in several web applications. MySQL uses SQL (Structured Query Language) for database access and pre-define the database schema which is based on requirements and make rules to manage the relationships between fields in tables.

Answer Image


It is one of the most popular NoSQL solutions which is used to help in data storage and the solution can certainly store documents on the World Wide Web. MongoDB was first created in 2007. The most excellent features of MongoDB is data storage in a dynamic schema which is different from the tabular DB characteristic of SQL. It is based on JSON (Java Script Object Notation) format) which is used for the transfer of data between web applications and servers using a human readable format. It was designed with high availability and scalability.

Answer Image

Differences between MySQL and MongoDB:

There are several differences between MySQL and MongoDB which are discussed here.

  • The main difference is in the representation of data in two databases. MySQL represents the data in tables and rows whereas MongoDB represents the data in a collection of JSON documents.
  • The main advantage in MySQL is the JOIN operation. This operation is used for querying across several tables. MongoDB does not use this operation and supports multi-dimensional data types.
  • If MySQL is being used then make one table for comments and another for posts to make a blog while in MongoDB, only one array of comments and one collection of posts can be used within a post.
  • MySQL can use many operations within a transaction and can also be used in a single operation. It supports atomic transactions. MongoDB does not support atomic transactions.
  • The performance of MongDB is better than the MySQL because MongoDB gives up joins and has outstanding presentation analysis tools. While the performance of MySQL is poor.
Latest Questions
Top Writers