MongoDB NoSQL

MongoDB NoSQL: As MongoDB is a NoSQL database, we need to know about what exactly is NoSQL. The notation NoSQL means "not only SQL." The term was coined by Carlo Strozzi in 1998. It means NoSQL can apply the query concepts of SQL. NoSQL is a non-relational database that is quite easy to scale. Companies like Facebook, Twitter, and Google that collect a huge amount of user data every day, need NoSQL. 

RDBMS uses SQL syntax to perform operations on data for information retrieval. But a NoSQL database system includes a wide range of database technologies that can store polymorphic data that may be either structured, unstructured, or semi-structured.

Why do we need NoSQL?

As RDBMS is used for a significant volume of data, the response time of the system becomes quite slow. This problem can be resolved by scaling up our systems. "Scale up," or the vertical scaling is done by upgrading the hardware, but it's costly for the organization.

Another approach is to distribute the excess database load on multiple numbers of the host. This approach is called "scaling out."

Since NoSQL is a non-relational database here, the scaling out is much better.

Features of NoSQL

  1. It is a Non-relational database.
  2. It does not need a schema.
  3. It follows a distributed approach.
  4. It has a straightforward API.

What are the different types of NoSQL?

1.Key-value

Here data is stored as key/value pairs. It is designed to handle a massive volume of data and heavy load. Working with key-value is entirely different from the relational database. A relational database works on pre-defined data structure on multiple tables with specified data types, while here, the data stores selected from a variety of optimal options.

The shopping cart content that needs schema-less data uses this database.

2. Document-based

The model that does not require tables and SQL but use documents with proper values and descriptions are called document-based databases. They are schema-less and follow any structure. It has many similarities of key-based but differentiates only in the data processing.

3. Column based

Column based databases store data in the columns instead of rows, thus making the search operation and retrieval faster on each column. But inserts and updates queries are somewhat slower. Column based database is more flexible because, within the same table, we can change the name of the column for each row. 

4.Graph-based 

As Multi-relational nature of graph-based database become stronger as compared to a relational database where relations are loosely connected. The graph-based database works on the entity attributes value model. An entity is represented as node while the relationship is represented as edges with its unique identity. With this representation, the relationship between data can be easily described. A most popular graph database, Neo4j, renames the terminology to Node-Relationship Property.

The traditional database system uses the concept of a foreign key to show the relationship between two or more entities while graph bases database gives freedom to establish a virtual relationship on run time.