What is MongoDB?

In my previous blogs I wrote about MEAN/MERN stack, and Node.js. If you noticed, there’s a specific NoSQL database I mentioned, that database being MongoDB. In this blog I’m going to help you understand what MongoDB is and what it’s used for. The document model of MongoDB is simple to learn and use for developers, while still providing all the capabilities needed at any scale to meet the most complex requirements. Not only does MongoDB provide support for JavaScript, but it also supports 10+ different languages, such as: C, C++, C#, Java, Node. js, etc.

Differences between MongoDB/NoSQL vs. SQL:

  • SQL databases come with fixed rows, and columns, as opposed to MongoDB which are JSON documents, Key-value: key-value pairs, Wide-column: tables with rows and dynamic columns, and Graph: nodes and edges.
  • SQL is older as it was developed in the 1970s that focused on reducing data duplication, as opposed to a NoSQL database that was built with a focus on scaling in the late 2000s and enabling rapid application change driven by agile and DevOps practices.
  • Oracle, MySQL, Microsoft SQL Server, and PostgreSQL, etc are all SQL databases, as opposed to MongoDB, DynamoDB, CouchDB, Amazon Neptune, etc which are all NoSQL databases.

These are just some of the differences between MongoDB/NoSQL as opposed to SQL databases.

What are some benefits of using MongoDB?

  • If your database goes down, MongoDB will detect failures natively, automatically choosing a new primary node in the majority of cases in less than five seconds. Applications will continue to operate while
    the node that is malfunctioning is replaced.
  • MongoDB has a lower latency per query & spends less CPU time per query because it is doing a lot less work. As a result, it can accommodate a higher
    load and is therefore frequently used if you have a massive number of users.
  • NoSQL databases have very versatile schemas. When specifications shift, a versatile schema enables you to easily make changes to your database. To deliver value to your customers faster, you can consistently add new application functionality.
  • Queries in NoSQL databases can be faster than SQL databases.
  • When you exceed the capacity requirements of your current server, most SQL databases require you to scale up vertically (migrate to a bigger, more costly server). In comparison, most NoSQL databases allow you to scale horizontally, which means that when you need to, you can add cheaper, commodity servers.

I hope this blog has helped you understand MongoDB/NoSQL better, and hope it will help you choose which DB to use in your future project!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store