MongoDB is an open-source document database and a leading NoSQL database. MongoDB is developed by MongoDB, Inc.
MongoDB is written in C++.
In the RDBMS database, a table can have multiple rows and columns. Similarly, in MongoDB, a collection can have multiple documents that 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
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 | RDBMS |
---|---|
Document-oriented and non-relational database | Relational database |
Document-based | Row-based |
Collection based and key-value pair | Table based |
Gives JavaScript client for querying | Doesn’t give JavaScript for querying |
Relatively easy to setup | Comparatively not that easy to setup |
Unaffected by SQL injection | Quite vulnerable to SQL injection |
Has dynamic schema and ideal for hierarchical data storage | Has predefined schema and not good for hierarchical data storage |
100 times faster and horizontally scalable through sharding | By increasing RAM, vertical scaling can happen |
There is no concept of joins | Joins sometimes form across tables to obtain the data. |
In a single MongoDB server, there are multiple databases present.