Introduction Of MongoDB

There are some key points of using Mongo DB. These are as follows,

  • Documents
    In Mongo Db we are using Documents instead of Tables as we are working in SQL. And these Documents are structured in BSON which is most identical to the web language JSON.
  • NoSQL
    It is NoSQL or Non-Relational database. The main difference when compared to SQL Database is you are not able to use joins to connect your database tables; however, we can use references to link between your various Documents

Why Use MongoDB over traditional SQL?

Some key advantages are,

  • Easy Schema Iteration
    It is quick and easy to make iteration on your schema.

  • Scalability & Performance
    When compared to relational databases NoSQL is more scalable and provides better performance.

  • Object Oriented
    It is object oriented so the administration of adding, reading & writing looks very similar to JavaScript code.

  • According to Mongo DB
    NoSQL database Accommodates large volumes of rapidly changing structured, semi structured and unstructured data and that basically means you are able to add your schema as need change.

For Example

If you have a schema contain some attributes:

  1. Person {  
  2.     FirstName: “Lory”,  
  3.     LastName: “Peter”  
  4. }  

Then if you realize that there must be a phone number then you can easily update your schema by adding the property

  1. Person {  
  2.     FirstName: “Lory”,  
  3.     LastName: “Peter”  
  4.     Number: “059 - 233 - 233”  
  5. }  

For further differences you can go through this link,

  • Documents and Collection
    Documents are defined as a record in MongoDB and basic unit of data in mongo DB. Documents look like JSON Objects but they are exists as BSON.
  • Collection
    Collection is defined as a grouping of MongoDB documents. Typically all documents in a collection have a similar or relates purpose.