Sanjivani Rural Education Society’s
Sanjivani College of Engineering, Kopargaon-423 603
(An Autonomous Institute, Affiliated to Savitribai Phule Pune University, Pune)
NACC ‘A’ Grade Accredited, ISO 9001:2015 Certified
Department of Computer Engineering
(NBA Accredited)
Prof. Monika Agrawal
Assistant Professor
E-mail : agrawalmonikacomp@sanjivani.org.in
Contact No: 8770361037
Course:CO210
Database Management System
Unit 6 - NoSQL Databases
Lecture -2: Introduction to Mongo DB
SQL vs NoSQL
 NoSQL (often interpreted as Not only SQL) database
 It provides a mechanism for storage and retrieval of data
that is modeled in means other than the tabular relations
used in relational databases.
SQL NoSQL
Relational Database Management System (RDBMS) Non-relational or distributed database system.
These databases have fixed or static or predefined schema They have dynamic schema
These databases are best suited for complex queries These databases are not so good for complex queries
Vertically Scalable Horizontally scalable
Follows ACID property Follows CAP Theorem.
Graph database
Document-oriented
Column family
NoSQL Types
Why MongoDB Why not MySQL
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 4
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 5
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 6
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 7
What is MongoDB?
 MongoDB is an open source, document-oriented database designed with both
scalability and developer agility in mind.
 Instead of storing your data in tables and rows as you would with a relational
database, in MongoDB you store JSON-like documents with dynamic
schemas(schema-free, schema less).
{
"_id" : ObjectId("5114e0bd42…"),
“FirstName" : "John",
“LastName" : "Doe",
“Age" : 39,
“Interests" : [ "Reading", "Mountain Biking ]
“Favorites": {
"color": "Blue",
"sport": "Soccer“
}
}
RDBMS MongoDB
Database Database
Table Collection
Row Document (JSON, BSON)
Column Field
Index Index
Join Embedded Document
Partition Shard
RDBMS vs MongoDB
MongoDB does not need any pre-defined data schema
Every document could have different data!
{name: “brendan”,
boss: “will”}
{name: “matt”,
weight:60,
height: 72,
loc: [44.6, 71.3]}
{name: “will”,
eyes: “blue”,
birthplace: “NY”,
aliases: [“bill”, “ben”],
loc: [32.7, 63.4],
boss: ”ben”}
Schema Free
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 11
Collections
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 12
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 13
Document
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 14
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 15
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 16

Lecture 2 Difference between NoSQL and SQL.ppt

  • 1.
    Sanjivani Rural EducationSociety’s Sanjivani College of Engineering, Kopargaon-423 603 (An Autonomous Institute, Affiliated to Savitribai Phule Pune University, Pune) NACC ‘A’ Grade Accredited, ISO 9001:2015 Certified Department of Computer Engineering (NBA Accredited) Prof. Monika Agrawal Assistant Professor E-mail : agrawalmonikacomp@sanjivani.org.in Contact No: 8770361037 Course:CO210 Database Management System Unit 6 - NoSQL Databases Lecture -2: Introduction to Mongo DB
  • 2.
    SQL vs NoSQL NoSQL (often interpreted as Not only SQL) database  It provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. SQL NoSQL Relational Database Management System (RDBMS) Non-relational or distributed database system. These databases have fixed or static or predefined schema They have dynamic schema These databases are best suited for complex queries These databases are not so good for complex queries Vertically Scalable Horizontally scalable Follows ACID property Follows CAP Theorem.
  • 3.
  • 4.
    Why MongoDB Whynot MySQL DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 4
  • 5.
    DEPARTMENT OF COMPUTERENGINEERING, Sanjivani COE, Kopargaon 5
  • 6.
    DEPARTMENT OF COMPUTERENGINEERING, Sanjivani COE, Kopargaon 6
  • 7.
    DEPARTMENT OF COMPUTERENGINEERING, Sanjivani COE, Kopargaon 7
  • 8.
    What is MongoDB? MongoDB is an open source, document-oriented database designed with both scalability and developer agility in mind.  Instead of storing your data in tables and rows as you would with a relational database, in MongoDB you store JSON-like documents with dynamic schemas(schema-free, schema less). { "_id" : ObjectId("5114e0bd42…"), “FirstName" : "John", “LastName" : "Doe", “Age" : 39, “Interests" : [ "Reading", "Mountain Biking ] “Favorites": { "color": "Blue", "sport": "Soccer“ } }
  • 10.
    RDBMS MongoDB Database Database TableCollection Row Document (JSON, BSON) Column Field Index Index Join Embedded Document Partition Shard RDBMS vs MongoDB MongoDB does not need any pre-defined data schema Every document could have different data! {name: “brendan”, boss: “will”} {name: “matt”, weight:60, height: 72, loc: [44.6, 71.3]} {name: “will”, eyes: “blue”, birthplace: “NY”, aliases: [“bill”, “ben”], loc: [32.7, 63.4], boss: ”ben”} Schema Free
  • 11.
    DEPARTMENT OF COMPUTERENGINEERING, Sanjivani COE, Kopargaon 11
  • 12.
    Collections DEPARTMENT OF COMPUTERENGINEERING, Sanjivani COE, Kopargaon 12
  • 13.
    DEPARTMENT OF COMPUTERENGINEERING, Sanjivani COE, Kopargaon 13
  • 14.
    Document DEPARTMENT OF COMPUTERENGINEERING, Sanjivani COE, Kopargaon 14
  • 15.
    DEPARTMENT OF COMPUTERENGINEERING, Sanjivani COE, Kopargaon 15
  • 16.
    DEPARTMENT OF COMPUTERENGINEERING, Sanjivani COE, Kopargaon 16