MongoDB – Comparison with RDBMS
Here is the clear comparison between RDBMS (Relational Database Management System) and MongoDB:
| RDBMS | MongoDB |
|---|---|
| Database | Database |
| Table | Collection |
| Tuple/Row | Document |
| Column | Field |
| Table Join | Embedded Documents |
| Primary Key | Primary Key (Default key _id provided by MongoDB itself) |
Explanation:
- Database: Both RDBMS and MongoDB have the concept of a database, which is a container for storing data.
- Table: In RDBMS, a table stores data in rows and columns, whereas in MongoDB, a collection stores documents.
- Tuple/Row: In RDBMS, rows or tuples represent individual records, while in MongoDB, documents are used to represent individual records.
- Column: Columns in RDBMS are equivalent to fields in MongoDB documents, which hold data values.
- Table Join: RDBMS uses joins to combine data from multiple tables, while MongoDB uses embedded documents to represent related data in a single document, avoiding the need for joins.
- Primary Key: In RDBMS, a primary key uniquely identifies each row in a table. In MongoDB, each document has a unique identifier, and by default, MongoDB assigns an _id field as the primary key.
Recent Comments