Open In App

How MongoDB works ?

MongoDB is an open-source document-oriented database. It is used to store a larger amount of data and also allows you to work with that data. MongoDB is not based on the table-like relational database structure but provides an altogether different mechanism for storage and retrieval of data, that’s why known as NoSQL database. Here, the term ‘NoSQL’ means ‘non-relational’. The format of storage is called BSON ( similar to JSON format).

Now, let’s see how actually this MongoDB works? But before proceeding to its working, first, let’s discuss some important parts of MongoDB –



Working of MongoDB –

The following image shows how the MongoDB works:

MongoDB work in two layers –



Application Layer is also known as the Final Abstraction Layer, it has two-parts, first is a Frontend (User Interface) and the second is Backend (server). The frontend is the place where the user uses MongoDB with the help of a Web or Mobile. This web and mobile include web pages, mobile applications, android default applications, IOS applications, etc. The backend contains a server which is used to perform server-side logic and also contain drivers or mongo shell to interact with MongoDB server with the help of queries.

These queries are sent to the MongoDB server present in the Data Layer. Now, the MongoDB server receives the queries and passes the received queries to the storage engine. MongoDB server itself does not directly read or write the data to the files or disk or memory. After passing the received queries to the storage engine, the storage engine is responsible to read or write the data in the files or memory basically it manages the data.

Note: The reading and writing from the files are slow as compare to memory.

Article Tags :