MySQL is the most popular relational database which is free to use. It is normal for many of the MySQL users to think – why we will learn MongoDB or any noSQL? Typically, MongoDB is for a different type of applications to meet today’s need. You can think the visitor tracking plugin for your WordPress website using MongoDB. It is not a good use-case of MongoDB, but probably points where MongoDB can be co-used.
How MongoDB Differs From MySQL
MySQL is one king of the relational databases. None going to compete with MySQL for its suitable use-cases. Any type of application which requires multi-row transactions would better suit a relational database. Accounting software is a good example of such. MySQL allows us to interact with the database which are using the structured query language. PostgreSQL, Microsoft SQL Server is other good software which can handle SQL as a query language. SQL is quite powerful. That brings the disadvantages as some queries require the data to be stored on the same server else the query would be slower. That makes MySQL commands difficult to decipher by a newbie!
When you have a flexible schema, then a document store like MongoDB is a good fit. This is difficult to implement in a performant manner in RDBMS and more difficult to make it faster. You can kick MongoDB to work. MySQL commands you to follow the rules. MongoDB has a variety of use cases. Real-time analytics is a good use-case, that is true. Others we commonly work with – the internet of things, mobile, and lighter content management systems. In MongoDB, documents can be used to store unstructured data. That is easier to update and retrieve. Over 10GB table on MySQL may degrade but MongoDB does not face this issue. As MongoDB is schema-less, we can add new fields. You need not worry about transaction safety like MySQL. MongoDB does not support ACID transactions, hence using it for more than official use-cases is dubious. MongoDB is easier to use than SQL databases in JavaScript. MongoDB is a good choice for an environment with many reads than many writes (possibly you hear the opposite).
---
MongoDB is too much limited. First, the data size in MongoDB will be higher as each document has field names stored it. There are no JOINs, so it is less flexible. You need something like Hadoop to work with real Big Data. You can not compare the huge documentation of MySQL with MongoDB.
The above screenshot is from extensive research by Dmitry Dolgov.
Tagged With mongodb mysql comparison 2019