Database Terminology - RDMS or MongoDB

 

RDMS or MongoDB

DBA's are confused, why?. Terminologies make a easier product confusing. MongDB is very good and easy product. why we make it confusing with new terminologies.

Let's have a look on terminologies to understand MongoDB from RDBMS perspective




Database: RDBMS vs. MongoDB

  • A traditional relational database is nothing but a set of tables.
  • In MongoDB, we also have a database, which is a set of collections.


Table:  RDBMS vs. MongoDB

  • A table is a set of rows,
  • Collection is a set of documents (collection of column name and value).

 

Relationships:  RDBMS vs. MongoDB (Parent-Child Tables vs. Nested Sub-Document or Array)

  • A table has a relationship to other tables, relations like one-to-one, one-to-many, or many-to-many by linking attributes from both tables.
  • MongoDB can express the relationships between collections similarly. However, MongoDB has an additional feature, the ability to take the fields of child table and embed it with the parent table as a single collection.
  • This grouping leads to a data model with far fewer collections than the number of tables in the corresponding relational model.

 

Index RDBMS vs. MongoDB

  • In RDBMS, indexes can be built on any number of columns in a table.
  • In MongoDB, because there is far less need to bring data together, indexes are often used for filtering, sorting and rarely for joining. Hence lower memory usage for indexes.
  • Building an index on a set of keys in a collection is equivalent of having an index that would be built on a set of tables.
  • And as for traditional relational databases, indexes in MongoDB are also the most important thing to look for to ensure excellent performance.


Row RDBMS vs. MongoDB

  • A row in a traditional relational database maps to a document in MongoDB.
  • However, a document is self-descriptive (Do u know JSON). A document includes the names of the columns for which it has data.


Column RDBMS vs. MongoDB

  • A column of a table translates to a key /field of a document.
  • The main difference is that each document can have a different list of fields, allowing for documents with different shapes (polymorphism) in a collection.


Join RDBMS vs. MongoDB (Embedding, Linking, or $lookup)

  • Joins are used in a relational database to get data from two or more tables.
  • With MongoDB, there is a $lookup operator to perform the same link between collections.
  • Additionally, some relationships are also expressed by embedding the child table in the parent table. For these relationship, there is no need to use the $lookup keyword, as the data is already pre-joined in the document. The document model makes things much natural and queries so much simpler.


View RDBMS vs. MongoDB

  • Relational views are also available in MongoDB and are also called views.


ACID RDBMS vs. MongoDB

  • The transactions you are used to in a traditional relational database are also available and named the same way in MongoDB.
  • The code that uses MongoDB transactions is remarkably similar to what you are used to with a traditional relational database.
  • Because MongoDB can store data in one document that is traditionally stored across rows in different tables, the need for transactions is much less than in relational systems.


 

No comments:
Write comments

Please do not enter spam links

Meet US

Services

More Services