SlideShare a Scribd company logo
MongoDB
1
Database Evolution
Flat Files RDBMS NoSQL MongoDB
1970s: data stored in flat
file system
1979: a standard
way of query the
data - what do we
want to query,
how to process
that query but
1998:
1. Key-value Store
2. Tabular
3. Document oriented
(MongoDB, CouchDB,
etc.)
2009: Free & Open
Source, Cross-
Platform, Document
Oriented
Problem:
no standard
implementation
Problem: with the
big n huge amount
data
Problem: Less support
for Complex Queries
Solution: Relational
Database
Solution: NoSQL Solution: Use Third-
Party GUIs
2
1. RDBMS’s do not well-scaling with very large size of data
2. RDBMS’s do not scale well to massive transaction rates
3. RDBMS’s cannot handle semi-structured data
4. RDBMS’s cannot handle unstructured data
5. RDBMS’s do not play well in a cloud environment
6. RDBMS’s cannot cope with changing or fuzzy schema specifications
and it is costly/impossible/slow to manage schema change
7. RDBMS’s cannot deal well with non-standard data like time series,
geospatial, or graph related data
3
NoSQL is a good solution to deal with these problems.
The problems with Relational Database:
What is NoSQL:
 NoSQL = Non SQL or Not only SQL
 Wikipedia’s definition:
4
A NoSQL database provides a mechanism for storage and retrieval of data
that is modeled in means other than the tabular relations used in relational
databases.
NoSQL Family 5
Knee Curve 6
What is MongoDB?
 Defination: 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(generally BSON) with dynamic schemas
(schema-free, schemaless).
7
Features
• Scalable High-Performance Open-source, Document-orientated
database.
• Built for Speed
• Rich Document based queries for Easy readability.
• Full Index Support for High Performance.
• Replication and Failover for High Availability.
• Auto Sharding for Easy Scalability.
• Map / Reduce for Aggregation.
8
WHAT IS MONGODB GREAT FOR?
• RDBMS replacement for Web Applications.
• Semi-structured Content Management.
• Real-time Analytics & High-Speed Logging.
• Caching and High Scalability
9
NOT GREAT FOR?
 Highly Transactional Applications.
 Problems requiring SQL.
 No referential integrity
 High degree of denormalization means updating
something in many places instead of one
10
Comparisons
RDBMS MongoDB
Relational database Document-oriented database, non relational
Schema based database, follow joins Schema-less database, references and
$lookup
Data stored in tables (tables contain
collection of rows)
Data stored in form of collection (collection
contain group of object document)
No horizontal scaling
Eg. 1st row has 5 column then 2nd row must
have 5 column for the given table
Horizontal scaling
Eg. 1st row has 5 column then 2nd row can
have any no of column for the given table
11
Data Format
JSON XML
{"employees“ :[
{"firstName":“Anju",
"lastName":“Shah"},
{"firstName":“Sumit Kumar",
"lastName":“Shah"},
{"firstName":“Shiva K.",
"lastName":“Shrestha"}
]}
<employees>
<employee>
<firstName>Anju</firstName>
<lastName>Shah</lastName>
</employee>
<employee>
<firstName>Sumit Kumar</firstName>
<lastName>Shah</lastName>
</employee>
<employee> <firstName>Shiva
K.</firstName>
<lastName>Shrestha</lastName>
</employee>
</employees>
12
Terminology Translation 13
SQL Terms/Concepts MongoDB Terms/Concepts
database database
table collection
row document
column field
index index
table joins (e.g. select queries) embedded documents and linking
Primary keys _id field is always the primary key
Aggregation (e.g. group by) aggregation pipeline
MongoDB Data Model 14
A collection includes documents.
MongoDB Data Model 15
Structure of a JSON-document:
The value of field:
 Native data types
 Arrays
 Other documents
MongoDB Data Model 16
Embedded documents:
The primary key
Installation
• Download and install suitable package for each platform [Windows, Linux,
Mac OSX, Solaris]
• Create a folder e.g. C:mongodb
• Go to bin of installation folder.
• Type following command: mongod --dbpath=C:/mongodb
• Run another command: mongo.exe
• The mongodb server is running.
17
CRUD
 Create
 db.collection.insert( <document> )
 db.collection.save( <document> )
 db.collection.update( <query>, <update>, { upsert: true } )
 Read
 db.collection.find( <query>, <projection> )
 db.collection.findOne( <query>, <projection> )
 Update
 db.collection.update( <query>, <update>, <options> )
 Delete
 db.collection.remove( <query>, <justOne> )
18
CRUD example
> db.user.insert({
first: "John",
last : "Doe",
age: 39
})
> db.user.find ()
{
"_id" : ObjectId("51…"),
"first" : "John",
"last" : "Doe",
"age" : 39
}
> db.user.update(
{"_id" : ObjectId("51…")},
{
$set: {
age: 40,
salary: 7000}
}
)
> db.user.remove({
"first": /^J/
})
19
Conclusions
 MongoDB is fast
 Very little CPU overhead
 Implemented in C++ for best performance
 Free & Open Source, Cross-Platform, Document Oriented
 Easier and faster integration of data
 useful when working with a huge quantity of data when the data's
nature does not require a relational model
 used when what really matters is the ability to store and retrieve great
quantities of data, not the relationships between the elements.
 Works on many platforms and there are many language drivers
20
Thank You!
21

More Related Content

What's hot

Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
JWORKS powered by Ordina
 
MongoDb - Details on the POC
MongoDb - Details on the POCMongoDb - Details on the POC
MongoDb - Details on the POC
Amardeep Vishwakarma
 
Mongo db
Mongo dbMongo db
Mongo db
Manish Trivedi
 
Mango Database - Web Development
Mango Database - Web DevelopmentMango Database - Web Development
Mango Database - Web Development
mssaman
 
MongoDB
MongoDBMongoDB
MongoDB
Albin John
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
Hyphen Call
 
MongoDB NYC Python
MongoDB NYC PythonMongoDB NYC Python
MongoDB NYC Python
Mike Dirolf
 
MongoDB DOC v1.5
MongoDB DOC v1.5MongoDB DOC v1.5
MongoDB DOC v1.5
Tharun Srinivasa
 
Mongo db workshop # 01
Mongo db workshop # 01Mongo db workshop # 01
Mongo db workshop # 01
FarhatParveen10
 
Introduction to mongo db by zain
Introduction to mongo db by zainIntroduction to mongo db by zain
Introduction to mongo db by zain
KenAndTea
 
Mongo db onepage
Mongo db onepageMongo db onepage
Mongo db onepage
Milind Zodge
 
performance analysis between sql ans nosql
performance analysis between sql ans nosqlperformance analysis between sql ans nosql
performance analysis between sql ans nosql
RUFAI YUSUF
 
Mongo db report
Mongo db reportMongo db report
Mongo db report
Hyphen Call
 
Back to Basics 2017 - Introduction to NoSQL
Back to Basics 2017 - Introduction to NoSQLBack to Basics 2017 - Introduction to NoSQL
Back to Basics 2017 - Introduction to NoSQL
Joe Drumgoole
 
Get expertise with mongo db
Get expertise with mongo dbGet expertise with mongo db
Get expertise with mongo db
Amit Thakkar
 
Open source Technology
Open source TechnologyOpen source Technology
Open source Technology
Amardeep Vishwakarma
 
Redis IU
Redis IURedis IU
Redis IU
Isaiah Edem
 
Mongo db
Mongo dbMongo db
Mongo db
Akshay Mathur
 
Introduction to MongoDB and CRUD operations
Introduction to MongoDB and CRUD operationsIntroduction to MongoDB and CRUD operations
Introduction to MongoDB and CRUD operations
Anand Kumar
 
MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for Beginners
Enoch Joshua
 

What's hot (20)

Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
 
MongoDb - Details on the POC
MongoDb - Details on the POCMongoDb - Details on the POC
MongoDb - Details on the POC
 
Mongo db
Mongo dbMongo db
Mongo db
 
Mango Database - Web Development
Mango Database - Web DevelopmentMango Database - Web Development
Mango Database - Web Development
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
 
MongoDB NYC Python
MongoDB NYC PythonMongoDB NYC Python
MongoDB NYC Python
 
MongoDB DOC v1.5
MongoDB DOC v1.5MongoDB DOC v1.5
MongoDB DOC v1.5
 
Mongo db workshop # 01
Mongo db workshop # 01Mongo db workshop # 01
Mongo db workshop # 01
 
Introduction to mongo db by zain
Introduction to mongo db by zainIntroduction to mongo db by zain
Introduction to mongo db by zain
 
Mongo db onepage
Mongo db onepageMongo db onepage
Mongo db onepage
 
performance analysis between sql ans nosql
performance analysis between sql ans nosqlperformance analysis between sql ans nosql
performance analysis between sql ans nosql
 
Mongo db report
Mongo db reportMongo db report
Mongo db report
 
Back to Basics 2017 - Introduction to NoSQL
Back to Basics 2017 - Introduction to NoSQLBack to Basics 2017 - Introduction to NoSQL
Back to Basics 2017 - Introduction to NoSQL
 
Get expertise with mongo db
Get expertise with mongo dbGet expertise with mongo db
Get expertise with mongo db
 
Open source Technology
Open source TechnologyOpen source Technology
Open source Technology
 
Redis IU
Redis IURedis IU
Redis IU
 
Mongo db
Mongo dbMongo db
Mongo db
 
Introduction to MongoDB and CRUD operations
Introduction to MongoDB and CRUD operationsIntroduction to MongoDB and CRUD operations
Introduction to MongoDB and CRUD operations
 
MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for Beginners
 

Similar to Mongo db

Everything You Need to Know About MongoDB Development.pptx
Everything You Need to Know About MongoDB Development.pptxEverything You Need to Know About MongoDB Development.pptx
Everything You Need to Know About MongoDB Development.pptx
75waytechnologies
 
Mongodb
MongodbMongodb
Mongodb
Apurva Vyas
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
Habilelabs
 
Mongodb
MongodbMongodb
Mongo db dhruba
Mongo db dhrubaMongo db dhruba
Mongo db dhruba
Dhrubaji Mandal ♛
 
MongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data scienceMongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data science
bitragowthamkumar1
 
MongoDB 2.4 and spring data
MongoDB 2.4 and spring dataMongoDB 2.4 and spring data
MongoDB 2.4 and spring data
Jimmy Ray
 
MongoDB.pptx
MongoDB.pptxMongoDB.pptx
MongoDB.pptx
Aayush Chimaniya
 
Copy of MongoDB .pptx
Copy of MongoDB .pptxCopy of MongoDB .pptx
Copy of MongoDB .pptx
nehabsairam
 
NoSQL and MongoDB
NoSQL and MongoDBNoSQL and MongoDB
NoSQL and MongoDB
Rajesh Menon
 
Mongo db
Mongo dbMongo db
Mongo db
Gyanendra Yadav
 
Mongodb By Vipin
Mongodb By VipinMongodb By Vipin
Mongodb By Vipin
Vipin Mundayad
 
mongodb11 (1) (1).pptx
mongodb11 (1) (1).pptxmongodb11 (1) (1).pptx
mongodb11 (1) (1).pptx
RoopaR36
 
Introduction to MongoDB.pptx
Introduction to MongoDB.pptxIntroduction to MongoDB.pptx
Introduction to MongoDB.pptx
Surya937648
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
Rajesh Kumar
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo db
Hemant Sharma
 
Introduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBIntroduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDB
Ahmed Farag
 
Top MongoDB interview Questions and Answers
Top MongoDB interview Questions and AnswersTop MongoDB interview Questions and Answers
Top MongoDB interview Questions and Answers
jeetendra mandal
 
MongoDB
MongoDBMongoDB
MongoDB
Albin John
 
MongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlMongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behl
TO THE NEW | Technology
 

Similar to Mongo db (20)

Everything You Need to Know About MongoDB Development.pptx
Everything You Need to Know About MongoDB Development.pptxEverything You Need to Know About MongoDB Development.pptx
Everything You Need to Know About MongoDB Development.pptx
 
Mongodb
MongodbMongodb
Mongodb
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
Mongodb
MongodbMongodb
Mongodb
 
Mongo db dhruba
Mongo db dhrubaMongo db dhruba
Mongo db dhruba
 
MongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data scienceMongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data science
 
MongoDB 2.4 and spring data
MongoDB 2.4 and spring dataMongoDB 2.4 and spring data
MongoDB 2.4 and spring data
 
MongoDB.pptx
MongoDB.pptxMongoDB.pptx
MongoDB.pptx
 
Copy of MongoDB .pptx
Copy of MongoDB .pptxCopy of MongoDB .pptx
Copy of MongoDB .pptx
 
NoSQL and MongoDB
NoSQL and MongoDBNoSQL and MongoDB
NoSQL and MongoDB
 
Mongo db
Mongo dbMongo db
Mongo db
 
Mongodb By Vipin
Mongodb By VipinMongodb By Vipin
Mongodb By Vipin
 
mongodb11 (1) (1).pptx
mongodb11 (1) (1).pptxmongodb11 (1) (1).pptx
mongodb11 (1) (1).pptx
 
Introduction to MongoDB.pptx
Introduction to MongoDB.pptxIntroduction to MongoDB.pptx
Introduction to MongoDB.pptx
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo db
 
Introduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBIntroduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDB
 
Top MongoDB interview Questions and Answers
Top MongoDB interview Questions and AnswersTop MongoDB interview Questions and Answers
Top MongoDB interview Questions and Answers
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlMongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behl
 

Recently uploaded

Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
sachin chaurasia
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMTIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
HODECEDSIET
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
enizeyimana36
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
zubairahmad848137
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
NazakatAliKhoso2
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
Las Vegas Warehouse
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 

Recently uploaded (20)

Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMTIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 

Mongo db

  • 2. Database Evolution Flat Files RDBMS NoSQL MongoDB 1970s: data stored in flat file system 1979: a standard way of query the data - what do we want to query, how to process that query but 1998: 1. Key-value Store 2. Tabular 3. Document oriented (MongoDB, CouchDB, etc.) 2009: Free & Open Source, Cross- Platform, Document Oriented Problem: no standard implementation Problem: with the big n huge amount data Problem: Less support for Complex Queries Solution: Relational Database Solution: NoSQL Solution: Use Third- Party GUIs 2
  • 3. 1. RDBMS’s do not well-scaling with very large size of data 2. RDBMS’s do not scale well to massive transaction rates 3. RDBMS’s cannot handle semi-structured data 4. RDBMS’s cannot handle unstructured data 5. RDBMS’s do not play well in a cloud environment 6. RDBMS’s cannot cope with changing or fuzzy schema specifications and it is costly/impossible/slow to manage schema change 7. RDBMS’s cannot deal well with non-standard data like time series, geospatial, or graph related data 3 NoSQL is a good solution to deal with these problems. The problems with Relational Database:
  • 4. What is NoSQL:  NoSQL = Non SQL or Not only SQL  Wikipedia’s definition: 4 A NoSQL database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases.
  • 7. What is MongoDB?  Defination: 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(generally BSON) with dynamic schemas (schema-free, schemaless). 7
  • 8. Features • Scalable High-Performance Open-source, Document-orientated database. • Built for Speed • Rich Document based queries for Easy readability. • Full Index Support for High Performance. • Replication and Failover for High Availability. • Auto Sharding for Easy Scalability. • Map / Reduce for Aggregation. 8
  • 9. WHAT IS MONGODB GREAT FOR? • RDBMS replacement for Web Applications. • Semi-structured Content Management. • Real-time Analytics & High-Speed Logging. • Caching and High Scalability 9
  • 10. NOT GREAT FOR?  Highly Transactional Applications.  Problems requiring SQL.  No referential integrity  High degree of denormalization means updating something in many places instead of one 10
  • 11. Comparisons RDBMS MongoDB Relational database Document-oriented database, non relational Schema based database, follow joins Schema-less database, references and $lookup Data stored in tables (tables contain collection of rows) Data stored in form of collection (collection contain group of object document) No horizontal scaling Eg. 1st row has 5 column then 2nd row must have 5 column for the given table Horizontal scaling Eg. 1st row has 5 column then 2nd row can have any no of column for the given table 11
  • 12. Data Format JSON XML {"employees“ :[ {"firstName":“Anju", "lastName":“Shah"}, {"firstName":“Sumit Kumar", "lastName":“Shah"}, {"firstName":“Shiva K.", "lastName":“Shrestha"} ]} <employees> <employee> <firstName>Anju</firstName> <lastName>Shah</lastName> </employee> <employee> <firstName>Sumit Kumar</firstName> <lastName>Shah</lastName> </employee> <employee> <firstName>Shiva K.</firstName> <lastName>Shrestha</lastName> </employee> </employees> 12
  • 13. Terminology Translation 13 SQL Terms/Concepts MongoDB Terms/Concepts database database table collection row document column field index index table joins (e.g. select queries) embedded documents and linking Primary keys _id field is always the primary key Aggregation (e.g. group by) aggregation pipeline
  • 14. MongoDB Data Model 14 A collection includes documents.
  • 15. MongoDB Data Model 15 Structure of a JSON-document: The value of field:  Native data types  Arrays  Other documents
  • 16. MongoDB Data Model 16 Embedded documents: The primary key
  • 17. Installation • Download and install suitable package for each platform [Windows, Linux, Mac OSX, Solaris] • Create a folder e.g. C:mongodb • Go to bin of installation folder. • Type following command: mongod --dbpath=C:/mongodb • Run another command: mongo.exe • The mongodb server is running. 17
  • 18. CRUD  Create  db.collection.insert( <document> )  db.collection.save( <document> )  db.collection.update( <query>, <update>, { upsert: true } )  Read  db.collection.find( <query>, <projection> )  db.collection.findOne( <query>, <projection> )  Update  db.collection.update( <query>, <update>, <options> )  Delete  db.collection.remove( <query>, <justOne> ) 18
  • 19. CRUD example > db.user.insert({ first: "John", last : "Doe", age: 39 }) > db.user.find () { "_id" : ObjectId("51…"), "first" : "John", "last" : "Doe", "age" : 39 } > db.user.update( {"_id" : ObjectId("51…")}, { $set: { age: 40, salary: 7000} } ) > db.user.remove({ "first": /^J/ }) 19
  • 20. Conclusions  MongoDB is fast  Very little CPU overhead  Implemented in C++ for best performance  Free & Open Source, Cross-Platform, Document Oriented  Easier and faster integration of data  useful when working with a huge quantity of data when the data's nature does not require a relational model  used when what really matters is the ability to store and retrieve great quantities of data, not the relationships between the elements.  Works on many platforms and there are many language drivers 20

Editor's Notes

  1. https://infocus.emc.com/april_reeve/big-data-and-nosql-the-problem-with-relational-databases/ 1min
  2. https://www.mongodb.com/nosql-explained http://aryannava.com/2014/04/06/nosql-databases-family/
  3. Easy Assess Provide up-to-date copy of data Easily added extra column without affecting others Secured Monitored, automated & integrated with our existing infrastructure Millions ops/sec, 100 Billions Documents, Peta Bytes of Data
  4. What is the index in MongoDB Embedded documents and linking?? Aggregation pipeline?? http://docs.mongodb.org/manual/core/data-model-design/
  5. The schema is very flexible. Documents in each collection can have different structures.
  6. The schema is very flexible. Documents in each collection can have different structures.
  7. With embedded documents, we do not need complicated join table. Why objectId1 – a hex string
  8. Create The field name _id is reserved for use as a primary key; its value must be unique in the collection, is immutable, and may be of any type other than an array. The field names cannot start with the $ character. The field names cannot contain the . character. Create with save If the <document> argument does not contain the _id field or contains an _id field with a value not in the collection, the save() method performs an insert of the document. Otherwise, the save() method performs an update. sds