What is MongoDB? Explained in 5 minutes

MongoDB is widely used in a variety of applications, including content management systems, real-time analytics platforms, and online marketplaces.

What is MongoDB? Explained in 5 minutes

MongoDB is the most popular non-relational, document-oriented database that is designed to store large volumes of data.

“Hold on! What?”

Alright! Let’s break it down a bit.

Our Senior Curriculum Instructor Prabhanjan explains MongoDB 

What is a database?

A database is an organized collection of structured information or data that is stored in a way so we can easily access, retrieve, manage, and update data when needed. It is stored electronically on a computer system and makes data management easy.

Still didn’t understand?

Let’s say you own a library. Consider each book as a data unit. Now, you have to perform the basic function of book lending, so your objective would be to search for a particular book efficiently. How easy your search is would depend on how well you have stored the books, i.e. labeled racks, bookshelves, drawers, etc. which the borrower might not know about. So, your library is a real-world database.

Snapshot from video explaining database
What is a database?

Similarly, in the case of a web application, when a user makes a request on the client side, it passes through multiple stages and reaches the database. Depending on the type of file requested, the server-side script gathers and processes the data and sends it back.

Now, there are multiple types of databases in use today. Some of the most common database management systems include-

Hierarchical Databases

Originally developed in the 1960s, a hierarchical database is a type of database that uses a tree-like structure to represent the relationships between different pieces of data. In a hierarchical database, each piece of data (called a record) is stored as a node in the tree, with the relationships between the nodes representing the connections between the different records.

For example- A hierarchical database of employees at a company.

Relational Database

A relational database is a type of database that organizes data into tables and allows for the creation of relationships between different tables using foreign keys.

Snapshot from video explaining SQL
Relational Database(SQL)

In a relational database, each table represents a different entity or concept, such as customers, orders, or products. Relational databases are widely used in a variety of applications, including online stores, financial systems, and customer relationship management systems.

SQL(Structured Query Language) is the standard language for dealing with relational databases such as MySQL, Oracle, PostgreSQL, etc.

Non-relational Database

Non-relational database management systems, also known as NoSQL evolved in response to the demands of increasingly complex modern online applications, and their varieties have multiplied over the last decade.

Snapshot from video explaining MongoDB
MongoDB stores data as a document

One of the key differences between relational and non-relational databases is the way they handle relationships between different pieces of data. In a relational database, relationships between data are established using foreign keys, which link rows in different tables together. In a non-relational database, relationships between data may be represented in a variety of different ways, depending on the specific data model being used.

So, what is MongoDB after all?

Coming back to the start,  MongoDB is a popular open-source non-relational database management system (DBMS) that is designed to store and manage large amounts of data. It uses a document-oriented data model, which means that it stores data as a collection of documents rather than as a set of tables with rows and columns.

One of the key features of MongoDB is its ability to handle large volumes of structured and unstructured data. It can store data in a variety of formats, including text, images, and binary data, and it supports fast read and write operations. MongoDB also provides features for indexing and searching data, as well as for securing and replicating data across multiple servers.

MongoDB is widely used in a variety of applications, including content management systems, real-time analytics platforms, and online marketplaces.

Wrapping Up

Students at Masai learn to work with MongoDB as part of the MERN stack in the full-stack web development course. Our Senior Curriculum Instructor, Prabhanjan Padhye gives us a surface-level understanding of MongoDB in the short video above.

Watch the video to learn more about MongoDB and relational, and non-relational databases, and get a front-row experience(albeit for a short while) of how our students learn different concepts with our seasoned instructors.