What is the MongoDB?
MongoDB is an open-source document database and leading NoSQL database. MongoDB is developed by MongoDB Inc.
MongoDB is written in C++.
MongoDB is not a Relational Database Management System (RDBMS). It’s called a “NoSQL” database.
It stores data in the collections as JSON-based documents and does not enforce schemas.
In the RDBMS database, a table can have multiple rows and columns. Similarly in MongoDB, a collection can have multiple documents which are equivalent to the rows
In the RDBMS database, a table can have multiple rows and columns. Similarly in MongoDB, a collection can have multiple documents which are equivalent to the rows
- Like any database system, MongoDB allows you to Insert, Update, Delete, and Select data. In addition, it supports other features including:
- Indexing
- Aggregation
- Specify collection and index types
- File Storage
MongoDB vs RDBMS
You can directly compare the MongoDB NoSQL with the RDBMS and map the varied terminologies in the two systems: The RDBMS table is a MongoDB collection, the column is a field, the tuple/row is a document, and the table join is an embedded document. The typical schema of a relational database shows the number of tables and the relationship between the tables, but MongoDB does not follow the concept of relationship.
MongoDB Architecture
- The following are the components of MongoDB architecture:
- Database
- Collection
- Document
- Database
It is also called the physical container for data.
Every database has its own set of files existing on the file system.
In a single MongoDB server, there are multiple databases present.
- Collection
The collection consists of various documents from different fields.
All the collections reside within one database. In collections no schemas are present.
- Document
The set of key values is assigned to the document which is in turn associated with dynamic schemas.
The benefit of using these schemas is that a document may not have to possess the same fields whereas they can have different data types.