Introduction to MongoDB

0

MongoDB is a NoSQL database written in C,C++ and JavaScript.  It’s an opensource document database developed by MongoDB Inc. The first version was released on 11th February 2009.

MongoDB uses JSON like document and schema. Popularly MongoDB is used in MERN (MongoDB+ExpressJs+React&Redux+ NodeJs) and MEAN  (MongoDB+ExpressJs+AngularJs+ NodeJs) Stacks.

To work on MongoDB basic knowledge or idea of database, text editors will be required. Having an understanding of RDBMS (Relational Database Management System) will be an added advantage.

Common Terms of  MongoDB

There are mainly 5 terms you need to know in MongoDB

  1. Documents – A document (Similar to Tuple/Row in RDBMS) can be defined as a set of key-value pairs. Documents hold dynamic schema. When we say dynamic schema it means that documents in the same collection do not need to have the same set of fields and structure. Common fields in a collection’s documents may hold different types of data.
  2. Collections- Collection (Similar to Table in RDBMS) is a group of documents. A collection exists within a single database. Collection does not enforce a schema. Document within a collection can have different fields. Typically, all documents in a collection are of similar purpose.
  3. Others –  Fields in MongoDB is similar to column in RDBMS, Primary key is provided as key_id and provided by MongoDB itself.  Embedded documents in MongoDB are equivalent to Table Join in RDBMS.

Why MongoDB?

  1. Anybody attribute can be indexed.
  2. Data is stored in JSON style documents and can directly be used on multiple platforms.
  3. Supports Auto Shredding
  4. Replication can be done easily
  5. Faster in-place updates.
  6. Tuning
  7. Simplified Joins
  8. Easily structure a single object.
  9. Easily to scale
  10. Mapping of application objects to database objects is not required.
  11. It uses internal memory to store the working set, which enables faster data access.
  12. Deep query-ability
  13. Huge online community for professional support.

Leave a Reply

Your email address will not be published. Required fields are marked *