MongoDB is a document-oriented storage model developed by MongoDB Inc. in 2009. It does not support joins and does not follow any transaction properties. It follows agile practices. It consists of a dynamic data schema and is horizontally scalable. It supports MapReduce. It makes use of the JSON query language and includes secondary indexes. It does not have triggers and also, it does not use the concept of foreign keys.
SQL, on the other hand, is a relational database management system (RDBMS) developed by Microsoft in 1989. It widely supports joins and follows ACID (atomicity, consistency, isolation, and durability) properties of a transaction. It does not follow any agile practice. It has a fixed data schema in is scalable vertically. Unlike MongoDB, it does not support MapReduce. It uses SQL query language and also includes secondary indexes. It contains both triggers and foreign keys.
Even though they both have pros and cons, you should use MongoDB over SQL for the following reasons:
- The object structure is clear
- There are no complex joins
- Easy to scale
- Supports dynamic query
- You are not required to map application objects to the database objects
Also, watch this video to know more about why you should use MongoDB over SQL: