SlideShare a Scribd company logo
Introduction to
Prof Mayur S Patil,
Assistant Professor,
Dept. of Computer Engineering,
MIT Academy of Engineering, Alandi (D.)
Contents
• Databases
• Purpose of Databases
• Types of Databases
• Relational Model
• Relational Databases
• What is MongoDB?
• Basics of MongoDB
• CRUD Terms
• Limitations
• Current Trending
Databases
• Data + Base
• Add
• Access
• Update
• Delete
Purpose of Databases
• Easy to inject and retrieve data
• Able to store and use sets of data
• To get faster and accurate access of data through organized ways.
• Query data in a database (ask it questions).
• Relate data from two different tables together using JOINs.
• Create meaningful reports from data in a database.
• Information of a given type is always stored only once.
• Fault-tolerant.
• Concurrent; multiple users can use them at the same time without
corrupting the data.
Applications:
Early Phase: Airline, Accounting, Railway reservation.
Now Trending:
 Social Networks: Facebook, Twitter.
 Search Engines: Bing, Google.
 Cloud Services: Amazon, Openstack.
 Big Data: Hadoop.
Types of Databases
• Relational Databases:
 MySQL – Facebook, Twitter.
 PostGreSQL -
 SQLite – Browsers.
• Non Relational Databases:
 MongoDB document
 CouchDB document
 ArangoDB
 Cassandra
Relational Model
• The relational model (RM) for database management is an approach
to managing data using a structure and language.
• In the relational model of a database, all data is represented in terms
of tuples and grouped into relations.
• A database organized in terms of the relational model is a relational
database.
Relational Databases
• A database structured to recognize relations between stored items of
information.
• Data organization approach
 Tables
 Row
 Columns
RDBMS
• Introduction
• Systems that used relational databases known as RDBMS.
• It used SQL.
• DML – Update.
• DDL – New things
• DCL – Control Access
• Advantages
• Building a low-volume, medium-complexity suite of applications that will evolve over time.
• Data volumes (duplicated) would be ridiculous if you didn’t do a reasonable amount of
normalization.
• You simply don’t see a cost/benefit advantage to moving away from proven legacy technology.
• Limitations
• Data Complexity
• Broken Keys and Records
• Developer Expertise
• Hardware Performance
Introduction to MongoDB
• MongoDB (from "humongous“ i.e. huge + Monstrous) is a scalable, high-performance, open
source, schema-free, document-oriented database.
- mongodb.org
• It used NoSQL mechanism.
• A record in MongoDB is a document.
• The advantages of using documents are:
• Documents (i.e. objects) correspond to native data types in many programming languages.
• Data structure composed of field and value pairs.
Comparing Terminologies
SQL Terminologies NoSQL Terminologies
Database Database
Table Collection
Row Document
Features of MongoDB
• High Performance
• I/O results
• Faster keys
• High Availability
• Replica Set
• Automatic Scaling
• Sharding
• Automatic balancing for changes in load and data distribution
• Easy addition of new machines without down time
• Scaling to one thousand nodes
• No single points of failure
• Automatic failover
• One or more shards, each shard holds a portion of the total
• Each shard is backed by a replica set
• Failure Management
• One or more routers, each one acts as a server for one or more clients.
• One or more clients, each one is (part of) the user's application and issues
commands to a router via the mongo client library (driver) for its language.
• mongod is server process and mongos is router process.
Basics of MongoDB
• JSON
•Stores data in Object format.
•It supports nested looping i.e. objects within array.
•Documents enclosed in circular braces.
•Objects are enclosed in curly braces and separated by
commas
•JSON supports
• Number,
• Strings,
• Objects
• Arrays
Example
db.things.save
(
{
a : 1, b : 1,
fruit:
["apple", "grapes", "pear" ]
}
)
BSON
•Its binary JSON i.e. format in which mongodb stores its data.
•MDB drivers send and receive data as BSON from app.
•On app side, MDB drivers maps BSON to native Data types in relative
to programming language.
•Why BSON:
• Lightweight: Its space required to for data keeping is minimum
• Traversable: Writing and reading indexes to MDB
• Efficient: Encoding data to BSON and Decoding from BSON by
drivers for app.
Application
Native Data types
MongoDB
Driver
BSON
Functioning of MongoDB
Working of MongoDB
• MongoDB is a server process that runs on Linux, Windows and
OS X
• It can be run both as a 32 or 64-bit application.
• Clients connect to the MongoDB process.
• MongoDB stores its data in files (default location is /data/db/),
and uses memory mapped files for data management for
efficiency.
CRUD Terms
Create Create Create
Read Insert Insert
Update Update Update
Delete Delete Remove
Limitations
• Joins: between two collections because it is difficult to scale out.
• Transaction: because documents are stored in hierarchical manner so
it is not possible to access those items atomically.
• Naming Restrictions
• Database Name Case Sensitivity
• BSON Documents
• BSON Document Size
• Max connection number is hardcoded to 20k.
• Auto rollback is not for more than 300 MB; more than this manual
intervention is needed.
• To shard a collection, it must be smaller than 256 GB, or else it will likely
fail to shard.
• Map / Reduce are single-threaded.
• Map / Reduce cannot output to sharded collections.
Trending
•Adobe – AEM
•Nokia – For Entertainment databases
•Facebook – Customer Data
•Google – Google Cloud Platform
•Ebay – Media Metadata
THANKS !

More Related Content

What's hot (20)

PPTX
Klevis Mino: MongoDB
Carlo Vaccari
 
PPT
MongoDb - Details on the POC
Amardeep Vishwakarma
 
PDF
Open source Technology
Amardeep Vishwakarma
 
PPTX
Common MongoDB Use Cases
MongoDB
 
PPT
NoSQL Databases
Carlos Alberto Benitez
 
PPTX
No SQL- The Future Of Data Storage
Bethmi Gunasekara
 
PPTX
Key-Value NoSQL Database
Heman Hosainpana
 
PPTX
MongoDB Schema Design by Examples
Hadi Ariawan
 
PPTX
Introduction to MongoDB
NodeXperts
 
PPT
9. Document Oriented Databases
Fabio Fumarola
 
PPTX
Introduction to NoSQL
PolarSeven Pty Ltd
 
ODP
Introduction to MongoDB
Dineesha Suraweera
 
PPT
Introduction to mongodb
neela madheswari
 
PPTX
NOSQL vs SQL
Mohammed Fazuluddin
 
PPTX
An Intro to NoSQL Databases
Rajith Pemabandu
 
PPTX
MongoDB
nikhil2807
 
PDF
MongoDB: What, why, when
Eugenio Minardi
 
PPTX
Mongo db
Akshay Mathur
 
PDF
01 nosql and multi model database
Mahdi Atawneh
 
PPTX
CSCi226PPT1
Mahima Verma
 
Klevis Mino: MongoDB
Carlo Vaccari
 
MongoDb - Details on the POC
Amardeep Vishwakarma
 
Open source Technology
Amardeep Vishwakarma
 
Common MongoDB Use Cases
MongoDB
 
NoSQL Databases
Carlos Alberto Benitez
 
No SQL- The Future Of Data Storage
Bethmi Gunasekara
 
Key-Value NoSQL Database
Heman Hosainpana
 
MongoDB Schema Design by Examples
Hadi Ariawan
 
Introduction to MongoDB
NodeXperts
 
9. Document Oriented Databases
Fabio Fumarola
 
Introduction to NoSQL
PolarSeven Pty Ltd
 
Introduction to MongoDB
Dineesha Suraweera
 
Introduction to mongodb
neela madheswari
 
NOSQL vs SQL
Mohammed Fazuluddin
 
An Intro to NoSQL Databases
Rajith Pemabandu
 
MongoDB
nikhil2807
 
MongoDB: What, why, when
Eugenio Minardi
 
Mongo db
Akshay Mathur
 
01 nosql and multi model database
Mahdi Atawneh
 
CSCi226PPT1
Mahima Verma
 

Viewers also liked (9)

PDF
Behavioural activity monitoring on CoreOS with Sysdig Falco
Sysdig
 
PDF
Kubernetes Introduction
Peng Xiao
 
PPTX
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
Daniel Bryant
 
DOCX
Kelompok 8 GEMPA BUMI, TSUNAMI DAN GUNUNG BERAPI
Nanda Reda
 
PPTX
Kubernetes Immersion
Juan Larriba
 
PDF
Google Cloud Computing compares GCE, GAE and GKE
Simon Su
 
PPTX
Introduction to container mangement
Martin Marcher
 
PDF
RootedCON 2017 - Docker might not be your friend. Trojanizing Docker images
Daniel Garcia (a.k.a cr0hn)
 
PDF
How Google Works
Eric Schmidt
 
Behavioural activity monitoring on CoreOS with Sysdig Falco
Sysdig
 
Kubernetes Introduction
Peng Xiao
 
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
Daniel Bryant
 
Kelompok 8 GEMPA BUMI, TSUNAMI DAN GUNUNG BERAPI
Nanda Reda
 
Kubernetes Immersion
Juan Larriba
 
Google Cloud Computing compares GCE, GAE and GKE
Simon Su
 
Introduction to container mangement
Martin Marcher
 
RootedCON 2017 - Docker might not be your friend. Trojanizing Docker images
Daniel Garcia (a.k.a cr0hn)
 
How Google Works
Eric Schmidt
 
Ad

Similar to Introduction to MongoDB Basics from SQL to NoSQL (20)

PPTX
When to Use MongoDB
MongoDB
 
PPT
MONGODB VASUDEV PRAJAPATI DOCUMENTBASE DATABASE
vasustudy176
 
PDF
Mongodb
Apurva Vyas
 
PPTX
Mongo db
Gyanendra Yadav
 
PDF
Mongo db basics
Claudio Montoya
 
PPTX
MongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB
 
PDF
MongoDB
Serdar Buyuktemiz
 
PDF
Mongo db 3.4 Overview
Norberto Leite
 
PPTX
Everything You Need to Know About MongoDB Development.pptx
75waytechnologies
 
PPTX
MongoDB
Albin John
 
PPTX
Big Data, NoSQL with MongoDB and Cassasdra
Brian Enochson
 
PPTX
Webinar: When to Use MongoDB
MongoDB
 
PPTX
Connect to NoSQL Database (MongoDB) using Node JS & Connect Node.js with NoSQ...
Kongu Engineering College, Perundurai, Erode
 
PPTX
MongoDB.pptx
Aayush Chimaniya
 
PDF
MongoDB Breakfast Milan - Mainframe Offloading Strategies
MongoDB
 
PPTX
MongoDB 2.4 and spring data
Jimmy Ray
 
PDF
Introduction to MongoDB and its best practices
AshishRathore72
 
PPTX
Dev Jumpstart: Build Your First App with MongoDB
MongoDB
 
PDF
how_can_businesses_address_storage_issues_using_mongodb.pdf
sarah david
 
When to Use MongoDB
MongoDB
 
MONGODB VASUDEV PRAJAPATI DOCUMENTBASE DATABASE
vasustudy176
 
Mongodb
Apurva Vyas
 
Mongo db
Gyanendra Yadav
 
Mongo db basics
Claudio Montoya
 
MongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB
 
Mongo db 3.4 Overview
Norberto Leite
 
Everything You Need to Know About MongoDB Development.pptx
75waytechnologies
 
MongoDB
Albin John
 
Big Data, NoSQL with MongoDB and Cassasdra
Brian Enochson
 
Webinar: When to Use MongoDB
MongoDB
 
Connect to NoSQL Database (MongoDB) using Node JS & Connect Node.js with NoSQ...
Kongu Engineering College, Perundurai, Erode
 
MongoDB.pptx
Aayush Chimaniya
 
MongoDB Breakfast Milan - Mainframe Offloading Strategies
MongoDB
 
MongoDB 2.4 and spring data
Jimmy Ray
 
Introduction to MongoDB and its best practices
AshishRathore72
 
Dev Jumpstart: Build Your First App with MongoDB
MongoDB
 
how_can_businesses_address_storage_issues_using_mongodb.pdf
sarah david
 
Ad

Recently uploaded (20)

PPTX
CST413 KTU S7 CSE Machine Learning Clustering K Means Hierarchical Agglomerat...
resming1
 
PPTX
Bitumen Emulsion by Dr Sangita Ex CRRI Delhi
grilcodes
 
PDF
Validating a Citizen Observatories enabling Platform by completing a Citizen ...
Diego López-de-Ipiña González-de-Artaza
 
PPTX
Work at Height training for workers .pptx
cecos12
 
PPTX
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
PPTX
Introduction to File Transfer Protocol with commands in FTP
BeulahS2
 
PDF
Generative AI & Scientific Research : Catalyst for Innovation, Ethics & Impact
AlqualsaDIResearchGr
 
PPTX
Tesla-Stock-Analysis-and-Forecast.pptx (1).pptx
moonsony54
 
PDF
CLIP_Internals_and_Architecture.pdf sdvsdv sdv
JoseLuisCahuanaRamos3
 
PPTX
Computer network Computer network Computer network Computer network
Shrikant317689
 
PPTX
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
rr22001247
 
PDF
Rapid Prototyping for XR: Lecture 2 - Low Fidelity Prototyping.
Mark Billinghurst
 
PPT
دراسة حاله لقرية تقع في جنوب غرب السودان
محمد قصص فتوتة
 
PDF
Decision support system in machine learning models for a face recognition-bas...
TELKOMNIKA JOURNAL
 
PDF
FSE-Journal-First-Automated code editing with search-generate-modify.pdf
cl144
 
PDF
lesson4-occupationalsafetyandhealthohsstandards-240812020130-1a7246d0.pdf
arvingallosa3
 
PPTX
How to Un-Obsolete Your Legacy Keypad Design
Epec Engineered Technologies
 
PDF
PRIZ Academy - Process functional modelling
PRIZ Guru
 
PPTX
MATERIAL SCIENCE LECTURE NOTES FOR DIPLOMA STUDENTS
SAMEER VISHWAKARMA
 
PDF
Rapid Prototyping for XR: Lecture 1 Introduction to Prototyping
Mark Billinghurst
 
CST413 KTU S7 CSE Machine Learning Clustering K Means Hierarchical Agglomerat...
resming1
 
Bitumen Emulsion by Dr Sangita Ex CRRI Delhi
grilcodes
 
Validating a Citizen Observatories enabling Platform by completing a Citizen ...
Diego López-de-Ipiña González-de-Artaza
 
Work at Height training for workers .pptx
cecos12
 
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
Introduction to File Transfer Protocol with commands in FTP
BeulahS2
 
Generative AI & Scientific Research : Catalyst for Innovation, Ethics & Impact
AlqualsaDIResearchGr
 
Tesla-Stock-Analysis-and-Forecast.pptx (1).pptx
moonsony54
 
CLIP_Internals_and_Architecture.pdf sdvsdv sdv
JoseLuisCahuanaRamos3
 
Computer network Computer network Computer network Computer network
Shrikant317689
 
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
rr22001247
 
Rapid Prototyping for XR: Lecture 2 - Low Fidelity Prototyping.
Mark Billinghurst
 
دراسة حاله لقرية تقع في جنوب غرب السودان
محمد قصص فتوتة
 
Decision support system in machine learning models for a face recognition-bas...
TELKOMNIKA JOURNAL
 
FSE-Journal-First-Automated code editing with search-generate-modify.pdf
cl144
 
lesson4-occupationalsafetyandhealthohsstandards-240812020130-1a7246d0.pdf
arvingallosa3
 
How to Un-Obsolete Your Legacy Keypad Design
Epec Engineered Technologies
 
PRIZ Academy - Process functional modelling
PRIZ Guru
 
MATERIAL SCIENCE LECTURE NOTES FOR DIPLOMA STUDENTS
SAMEER VISHWAKARMA
 
Rapid Prototyping for XR: Lecture 1 Introduction to Prototyping
Mark Billinghurst
 

Introduction to MongoDB Basics from SQL to NoSQL

  • 1. Introduction to Prof Mayur S Patil, Assistant Professor, Dept. of Computer Engineering, MIT Academy of Engineering, Alandi (D.)
  • 2. Contents • Databases • Purpose of Databases • Types of Databases • Relational Model • Relational Databases • What is MongoDB? • Basics of MongoDB • CRUD Terms • Limitations • Current Trending
  • 3. Databases • Data + Base • Add • Access • Update • Delete
  • 4. Purpose of Databases • Easy to inject and retrieve data • Able to store and use sets of data • To get faster and accurate access of data through organized ways. • Query data in a database (ask it questions). • Relate data from two different tables together using JOINs. • Create meaningful reports from data in a database. • Information of a given type is always stored only once. • Fault-tolerant. • Concurrent; multiple users can use them at the same time without corrupting the data.
  • 5. Applications: Early Phase: Airline, Accounting, Railway reservation. Now Trending:  Social Networks: Facebook, Twitter.  Search Engines: Bing, Google.  Cloud Services: Amazon, Openstack.  Big Data: Hadoop.
  • 6. Types of Databases • Relational Databases:  MySQL – Facebook, Twitter.  PostGreSQL -  SQLite – Browsers. • Non Relational Databases:  MongoDB document  CouchDB document  ArangoDB  Cassandra
  • 7. Relational Model • The relational model (RM) for database management is an approach to managing data using a structure and language. • In the relational model of a database, all data is represented in terms of tuples and grouped into relations. • A database organized in terms of the relational model is a relational database.
  • 8. Relational Databases • A database structured to recognize relations between stored items of information. • Data organization approach  Tables  Row  Columns
  • 9. RDBMS • Introduction • Systems that used relational databases known as RDBMS. • It used SQL. • DML – Update. • DDL – New things • DCL – Control Access • Advantages • Building a low-volume, medium-complexity suite of applications that will evolve over time. • Data volumes (duplicated) would be ridiculous if you didn’t do a reasonable amount of normalization. • You simply don’t see a cost/benefit advantage to moving away from proven legacy technology. • Limitations • Data Complexity • Broken Keys and Records • Developer Expertise • Hardware Performance
  • 10. Introduction to MongoDB • MongoDB (from "humongous“ i.e. huge + Monstrous) is a scalable, high-performance, open source, schema-free, document-oriented database. - mongodb.org • It used NoSQL mechanism. • A record in MongoDB is a document. • The advantages of using documents are: • Documents (i.e. objects) correspond to native data types in many programming languages. • Data structure composed of field and value pairs.
  • 11. Comparing Terminologies SQL Terminologies NoSQL Terminologies Database Database Table Collection Row Document
  • 12. Features of MongoDB • High Performance • I/O results • Faster keys • High Availability • Replica Set • Automatic Scaling • Sharding • Automatic balancing for changes in load and data distribution • Easy addition of new machines without down time • Scaling to one thousand nodes • No single points of failure • Automatic failover
  • 13. • One or more shards, each shard holds a portion of the total • Each shard is backed by a replica set • Failure Management • One or more routers, each one acts as a server for one or more clients. • One or more clients, each one is (part of) the user's application and issues commands to a router via the mongo client library (driver) for its language. • mongod is server process and mongos is router process.
  • 14. Basics of MongoDB • JSON •Stores data in Object format. •It supports nested looping i.e. objects within array. •Documents enclosed in circular braces. •Objects are enclosed in curly braces and separated by commas •JSON supports • Number, • Strings, • Objects • Arrays
  • 15. Example db.things.save ( { a : 1, b : 1, fruit: ["apple", "grapes", "pear" ] } )
  • 16. BSON •Its binary JSON i.e. format in which mongodb stores its data. •MDB drivers send and receive data as BSON from app. •On app side, MDB drivers maps BSON to native Data types in relative to programming language. •Why BSON: • Lightweight: Its space required to for data keeping is minimum • Traversable: Writing and reading indexes to MDB • Efficient: Encoding data to BSON and Decoding from BSON by drivers for app.
  • 18. Working of MongoDB • MongoDB is a server process that runs on Linux, Windows and OS X • It can be run both as a 32 or 64-bit application. • Clients connect to the MongoDB process. • MongoDB stores its data in files (default location is /data/db/), and uses memory mapped files for data management for efficiency.
  • 19. CRUD Terms Create Create Create Read Insert Insert Update Update Update Delete Delete Remove
  • 20. Limitations • Joins: between two collections because it is difficult to scale out. • Transaction: because documents are stored in hierarchical manner so it is not possible to access those items atomically. • Naming Restrictions • Database Name Case Sensitivity • BSON Documents • BSON Document Size • Max connection number is hardcoded to 20k.
  • 21. • Auto rollback is not for more than 300 MB; more than this manual intervention is needed. • To shard a collection, it must be smaller than 256 GB, or else it will likely fail to shard. • Map / Reduce are single-threaded. • Map / Reduce cannot output to sharded collections.
  • 22. Trending •Adobe – AEM •Nokia – For Entertainment databases •Facebook – Customer Data •Google – Google Cloud Platform •Ebay – Media Metadata