What is MongoDB?

Nethsara Liyanage
2 min readApr 5, 2021

MongoDB is a NoSQL database that is object-oriented, simple, dynamic, and scalable. The model is based on the NoSQL document store. Instead of storing the data in the columns and rows of a conventional relational database, the data items are stored as individual documents within a set. The MongoDB language was developed with the intention of building a data store with high performance, high availability, and automatic scaling. MongoDB is a very simple database to set up and use. MongoDB stores data in JSON or BSON documents. MongoDB is available in general distributions for Windows, Linux, Mac OS X, and Solaris.

Terminology and Concepts

Here we are going to make a comparison based on the terminology of between SQL server and MongoDB.

Making the Choice

Yes, it is hard to choose which database we should use in our projects. No matter whether it is SQL or Non-SQL it’s really hard. If we can go through their pros and cons, we can make our choices easily.

Pros

  • Document oriented
  • High performance
  • High availability — Replication
  • High scalability — Sharding
  • Dynamic — No rigid schema.
  • Flexible — field addition/deletion have less or no impact on the application
  • Heterogeneous Data
  • No Joins
  • Distributed
  • Data Representation in JSON or BSON
  • Geospatial support
  • Easy Integration with BigData Hadoop
  • A document-based query language that’s nearly as powerful as SQL
  • Cloud distributions such as AWS, Microsoft, RedHat,dotCloud and SoftLayer, etc:-. In fact, MongoDB is built for the cloud.

Cons

  • A downside of NoSQL is that most solutions are not as strongly ACID-compliant (Atomic, Consistency, Isolation, Durability) as the more well-established RDBMS systems.
  • Complex transaction
  • No function or stored procedure exists where you can bind the logic.

When to use and Not?

We can use MongoDB in the following type of implementations.

  • E-commerce product catalog.
  • Blogs and content management.
  • Real-time analytics and high-speed logging, caching, and high scalability.
  • Configuration management.
  • Maintaining location-based data -Geospatial data.
  • Mobile and social networking sites.
  • Evolving data requirements.
  • The loosely coupled objectives-the design may change by overtime.

IF you are going to use MongoDB databases in the following type of scenarios, that is not a good idea.

  • Highly transactional systems or where the data model is designed up front.
  • Tightly coupled systems

--

--