SlideShare a Scribd company logo
mongoDB
• Written in: C++
• Data model: uses BSON (binary JSON),
lightweight, traversable, efficient
• Based on ‘document model’
• Use NoSQL (not only SQL), SQL is used
for RDBMS
• Retains some friendly properties of SQL
• License: AGPL (Drivers:Apache)
Why?
Why?
Why?
Why?
Why?
Why?
Why?
Drawbacks of such complexity
 Hard to understand
 Hard to add features
 Inefficient
Imagine this was done in real world
Imagine this was done in real world
Imagine this was done in real world
Imagine this was done in real world
 mongoDB takes entirely different approach
 Here, Data is stored in records (called as
documents)
 Separate documents for each patient (example)
Illustration using Previous example
Illustration using Previous example
Illustration using Previous example
Illustration using Previous example
Hence,
 Efficient for computer to process
 Natural and easy for humans to read
 They can adapt
MongoDB terminology
 Databases
 Collections (Table in RDBMS)
 Documents (Tuple/Rows in RDBMS)
MongoDB Distributed Systems Architecture
Replication Sets
 Single-master!
 Maintains backup copies of database
instance
 Secondaries can elect a new primary within
seconds if primary goes down
Architecture
Replica Set Quirks
 Replicas only address durability, not ability to
scale
 A majority of the servers in your set must agree
on the primary
 Even number of servers (2) does not work
Architecture
Write process
 All write operation go through primary, which
applies the write operation.
 Write operation then records operations on
primary’s operation log “oplog”
 Secondary are continuously replicating the oplog
and applying the operations to themselves in an
asynchronous process
Architecture
Workloads Isolation
 Combines different classes of workload
Architecture
Sharding
 To meet the needs of app with large data sets and
high throughput requirements
Architecture
Sharding
 Mongos talks to exactly three Config server
Architecture
Sharding Quirks
 If any one config serves goes down, your entire
database goes down.
 Auto-sharding sometimes doesn’t work.
Architecture
Data Locality
 MongoDB zoned sharding allows precise control
over where data is physically stored in a cluster.
 Enables developers- data placement by
geographic region
 Developer can assign each shard to a zone
representing the physical location.
 Any number of shards can be associated with each
zone, and each zone can be scaled independently
of the other
Architecture
Data Security
 Authentication
 Offers integration with external security
mechanisms including Windows Active Directory,
Kerberos, etc.
 Authorization
 Enable to configure granular permission for user
 Auditing
 provide native audit log to track any DB operations
 Encryption
 On networks, on disk and in backups
Architecture
Freedom to Run Anywhere
 Many companies moving to public cloud
 MongoDB allows organizations to adopt cloud at
their own pace by moving select workloads as
needed.
 For example, They may run the same workload in
a hybrid environment to manage sudden peaks in
demand, or use the cloud to launch services in
regions where they lack a physical data center
presence.
Advantages over RDBMS
 Schema less
 Deep query ability
 Ease of scale-out
 Structure of single object is clear
 Uses internal memory for storing the working set,
enabling faster access of data
 Mapping of application objects to database
objects is not needed
Why use MongoDB?
 Document Oriented Storage
 Index on any attribute
 Replication and high availability
 Auto-sharding
 Rich queries
 Built-in aggregation capabilities, MapReduce,
GridFS
 Professional support by MongoDB
Where to use MongoDB?
 Big Data
 Content Management and Delivery
 Mobile and Social infrastructure
 User Data Management
 Data Hub
References-
 https://www.mongodb.com/what-is-mongodb
Mongodb Architectural Guide
 https://www.tutorialspoint.com/mongodb/
MongoDB Tutorials – TutorialsPoints
 Understanding mongodb, by Frank Kane - Youtube
video
 MongoDB in 5 minutes with Eliot Horowitz –
Youtube video
Thank You

More Related Content

What's hot

An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
César Trigo
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
Abhijeet Vaikar
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBAn Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDB
Lee Theobald
 
MongoDB Fundamentals
MongoDB FundamentalsMongoDB Fundamentals
MongoDB Fundamentals
MongoDB
 
Mongo DB Presentation
Mongo DB PresentationMongo DB Presentation
Mongo DB Presentation
Jaya Naresh Kovela
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
Hyphen Call
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
Mongo DB
Mongo DB Mongo DB
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
Alex Sharp
 
Indexing with MongoDB
Indexing with MongoDBIndexing with MongoDB
Indexing with MongoDB
MongoDB
 
MongoDB Administration 101
MongoDB Administration 101MongoDB Administration 101
MongoDB Administration 101
MongoDB
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
Universidade de São Paulo
 
Introduction to MongoDB.pptx
Introduction to MongoDB.pptxIntroduction to MongoDB.pptx
Introduction to MongoDB.pptx
Surya937648
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
Harri Kauhanen
 
SQL vs. NoSQL Databases
SQL vs. NoSQL DatabasesSQL vs. NoSQL Databases
SQL vs. NoSQL Databases
Osama Jomaa
 
Introduction to NoSQL Databases
Introduction to NoSQL DatabasesIntroduction to NoSQL Databases
Introduction to NoSQL Databases
Derek Stainer
 
MongodB Internals
MongodB InternalsMongodB Internals
MongodB Internals
Norberto Leite
 
Introducing MongoDB Atlas
Introducing MongoDB AtlasIntroducing MongoDB Atlas
Introducing MongoDB Atlas
MongoDB
 
Mongodb
MongodbMongodb

What's hot (20)

An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBAn Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDB
 
MongoDB Fundamentals
MongoDB FundamentalsMongoDB Fundamentals
MongoDB Fundamentals
 
Mongo DB Presentation
Mongo DB PresentationMongo DB Presentation
Mongo DB Presentation
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Mongo DB
Mongo DB Mongo DB
Mongo DB
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
 
Indexing with MongoDB
Indexing with MongoDBIndexing with MongoDB
Indexing with MongoDB
 
MongoDB Administration 101
MongoDB Administration 101MongoDB Administration 101
MongoDB Administration 101
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
Introduction to MongoDB.pptx
Introduction to MongoDB.pptxIntroduction to MongoDB.pptx
Introduction to MongoDB.pptx
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
SQL vs. NoSQL Databases
SQL vs. NoSQL DatabasesSQL vs. NoSQL Databases
SQL vs. NoSQL Databases
 
Introduction to NoSQL Databases
Introduction to NoSQL DatabasesIntroduction to NoSQL Databases
Introduction to NoSQL Databases
 
MongodB Internals
MongodB InternalsMongodB Internals
MongodB Internals
 
Introducing MongoDB Atlas
Introducing MongoDB AtlasIntroducing MongoDB Atlas
Introducing MongoDB Atlas
 
Mongodb
MongodbMongodb
Mongodb
 

Similar to Mongodb basics and architecture

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 tutorial
mongodb tutorialmongodb tutorial
mongodb tutorial
Jaehong Park
 
Introduction to MongoDB and its best practices
Introduction to MongoDB and its best practicesIntroduction to MongoDB and its best practices
Introduction to MongoDB and its best practices
AshishRathore72
 
Mongo presentation conf
Mongo presentation confMongo presentation conf
Mongo presentation conf
Shridhar Joshi
 
Silicon Valley Code Camp: 2011 Introduction to MongoDB
Silicon Valley Code Camp: 2011 Introduction to MongoDBSilicon Valley Code Camp: 2011 Introduction to MongoDB
Silicon Valley Code Camp: 2011 Introduction to MongoDB
Manish Pandit
 
Nosql seminar
Nosql seminarNosql seminar
Mongodb
MongodbMongodb
Mongodb
Apurva Vyas
 
MongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of viewMongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of view
Pierre Baillet
 
Benchmarking Couchbase Server for Interactive Applications
Benchmarking Couchbase Server for Interactive ApplicationsBenchmarking Couchbase Server for Interactive Applications
Benchmarking Couchbase Server for Interactive Applications
Altoros
 
Elasticsearch vs MongoDB comparison
Elasticsearch vs MongoDB comparisonElasticsearch vs MongoDB comparison
Elasticsearch vs MongoDB comparison
jeetendra mandal
 
nosql [Autosaved].pptx
nosql [Autosaved].pptxnosql [Autosaved].pptx
nosql [Autosaved].pptx
Indrani Sen
 
MongoDB
MongoDBMongoDB
Mongo db transcript
Mongo db transcriptMongo db transcript
Mongo db transcript
foliba
 
MONGODB VASUDEV PRAJAPATI DOCUMENTBASE DATABASE
MONGODB VASUDEV PRAJAPATI DOCUMENTBASE DATABASEMONGODB VASUDEV PRAJAPATI DOCUMENTBASE DATABASE
MONGODB VASUDEV PRAJAPATI DOCUMENTBASE DATABASE
vasustudy176
 
MongoDB
MongoDBMongoDB
Performance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBasePerformance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBase
SindhujanDhayalan
 
Comparison between mongo db and cassandra using ycsb
Comparison between mongo db and cassandra using ycsbComparison between mongo db and cassandra using ycsb
Comparison between mongo db and cassandra using ycsb
sonalighai
 
MongoDb - Details on the POC
MongoDb - Details on the POCMongoDb - Details on the POC
MongoDb - Details on the POC
Amardeep Vishwakarma
 
Azure cosmos db, Azure no-SQL database,
Azure cosmos db, Azure no-SQL database, Azure cosmos db, Azure no-SQL database,
Azure cosmos db, Azure no-SQL database,
BRIJESH KUMAR
 
Pros and Cons of MongoDB in Web Development
Pros and Cons of MongoDB in Web DevelopmentPros and Cons of MongoDB in Web Development
Pros and Cons of MongoDB in Web Development
Nirvana Canada
 

Similar to Mongodb basics and architecture (20)

MongoDB 2.4 and spring data
MongoDB 2.4 and spring dataMongoDB 2.4 and spring data
MongoDB 2.4 and spring data
 
mongodb tutorial
mongodb tutorialmongodb tutorial
mongodb tutorial
 
Introduction to MongoDB and its best practices
Introduction to MongoDB and its best practicesIntroduction to MongoDB and its best practices
Introduction to MongoDB and its best practices
 
Mongo presentation conf
Mongo presentation confMongo presentation conf
Mongo presentation conf
 
Silicon Valley Code Camp: 2011 Introduction to MongoDB
Silicon Valley Code Camp: 2011 Introduction to MongoDBSilicon Valley Code Camp: 2011 Introduction to MongoDB
Silicon Valley Code Camp: 2011 Introduction to MongoDB
 
Nosql seminar
Nosql seminarNosql seminar
Nosql seminar
 
Mongodb
MongodbMongodb
Mongodb
 
MongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of viewMongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of view
 
Benchmarking Couchbase Server for Interactive Applications
Benchmarking Couchbase Server for Interactive ApplicationsBenchmarking Couchbase Server for Interactive Applications
Benchmarking Couchbase Server for Interactive Applications
 
Elasticsearch vs MongoDB comparison
Elasticsearch vs MongoDB comparisonElasticsearch vs MongoDB comparison
Elasticsearch vs MongoDB comparison
 
nosql [Autosaved].pptx
nosql [Autosaved].pptxnosql [Autosaved].pptx
nosql [Autosaved].pptx
 
MongoDB
MongoDBMongoDB
MongoDB
 
Mongo db transcript
Mongo db transcriptMongo db transcript
Mongo db transcript
 
MONGODB VASUDEV PRAJAPATI DOCUMENTBASE DATABASE
MONGODB VASUDEV PRAJAPATI DOCUMENTBASE DATABASEMONGODB VASUDEV PRAJAPATI DOCUMENTBASE DATABASE
MONGODB VASUDEV PRAJAPATI DOCUMENTBASE DATABASE
 
MongoDB
MongoDBMongoDB
MongoDB
 
Performance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBasePerformance analysis of MongoDB and HBase
Performance analysis of MongoDB and HBase
 
Comparison between mongo db and cassandra using ycsb
Comparison between mongo db and cassandra using ycsbComparison between mongo db and cassandra using ycsb
Comparison between mongo db and cassandra using ycsb
 
MongoDb - Details on the POC
MongoDb - Details on the POCMongoDb - Details on the POC
MongoDb - Details on the POC
 
Azure cosmos db, Azure no-SQL database,
Azure cosmos db, Azure no-SQL database, Azure cosmos db, Azure no-SQL database,
Azure cosmos db, Azure no-SQL database,
 
Pros and Cons of MongoDB in Web Development
Pros and Cons of MongoDB in Web DevelopmentPros and Cons of MongoDB in Web Development
Pros and Cons of MongoDB in Web Development
 

Recently uploaded

How to Manage Access Rights & User Types in Odoo 17
How to Manage Access Rights & User Types in Odoo 17How to Manage Access Rights & User Types in Odoo 17
How to Manage Access Rights & User Types in Odoo 17
Celine George
 
E-learning Odoo 17 New features - Odoo 17 Slides
E-learning Odoo 17  New features - Odoo 17 SlidesE-learning Odoo 17  New features - Odoo 17 Slides
E-learning Odoo 17 New features - Odoo 17 Slides
Celine George
 
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
Nguyen Thanh Tu Collection
 
Parent PD Design for Professional Development .docx
Parent PD Design for Professional Development .docxParent PD Design for Professional Development .docx
Parent PD Design for Professional Development .docx
AntonioJarligoCompra
 
C Interview Questions PDF By Scholarhat.pdf
C Interview Questions PDF By Scholarhat.pdfC Interview Questions PDF By Scholarhat.pdf
C Interview Questions PDF By Scholarhat.pdf
Scholarhat
 
How To Sell Hamster Kombat Coin In Pre-market
How To Sell Hamster Kombat Coin In Pre-marketHow To Sell Hamster Kombat Coin In Pre-market
How To Sell Hamster Kombat Coin In Pre-market
Sikandar Ali
 
View Inheritance in Odoo 17 - Odoo 17 Slides
View Inheritance in Odoo 17 - Odoo 17  SlidesView Inheritance in Odoo 17 - Odoo 17  Slides
View Inheritance in Odoo 17 - Odoo 17 Slides
Celine George
 
JavaScript Interview Questions PDF By ScholarHat
JavaScript Interview  Questions PDF By ScholarHatJavaScript Interview  Questions PDF By ScholarHat
JavaScript Interview Questions PDF By ScholarHat
Scholarhat
 
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptxParkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
AnujVishwakarma34
 
11EHS Term 3 Week 1 Unit 1 Review: Feedback and improvementpptx
11EHS Term 3 Week 1 Unit 1 Review: Feedback and improvementpptx11EHS Term 3 Week 1 Unit 1 Review: Feedback and improvementpptx
11EHS Term 3 Week 1 Unit 1 Review: Feedback and improvementpptx
mansk2
 
MathematicsGrade7-Presentation-July-12024.pptx
MathematicsGrade7-Presentation-July-12024.pptxMathematicsGrade7-Presentation-July-12024.pptx
MathematicsGrade7-Presentation-July-12024.pptx
nolicaliso1
 
How to Manage Line Discount in Odoo 17 POS
How to Manage Line Discount in Odoo 17 POSHow to Manage Line Discount in Odoo 17 POS
How to Manage Line Discount in Odoo 17 POS
Celine George
 
1. Importance_of_reducing_postharvest_loss.pptx
1. Importance_of_reducing_postharvest_loss.pptx1. Importance_of_reducing_postharvest_loss.pptx
1. Importance_of_reducing_postharvest_loss.pptx
UmeshTimilsina1
 
QCE – Unpacking the syllabus Implications for Senior School practices and ass...
QCE – Unpacking the syllabus Implications for Senior School practices and ass...QCE – Unpacking the syllabus Implications for Senior School practices and ass...
QCE – Unpacking the syllabus Implications for Senior School practices and ass...
mansk2
 
Codeavour 5.0 International Impact Report - The Biggest International AI, Cod...
Codeavour 5.0 International Impact Report - The Biggest International AI, Cod...Codeavour 5.0 International Impact Report - The Biggest International AI, Cod...
Codeavour 5.0 International Impact Report - The Biggest International AI, Cod...
Codeavour International
 
DepEd School Calendar 2024-2025 DO_s2024_008
DepEd School Calendar 2024-2025 DO_s2024_008DepEd School Calendar 2024-2025 DO_s2024_008
DepEd School Calendar 2024-2025 DO_s2024_008
Glenn Rivera
 
SQL Server Interview Questions PDF By ScholarHat
SQL Server Interview Questions PDF By ScholarHatSQL Server Interview Questions PDF By ScholarHat
SQL Server Interview Questions PDF By ScholarHat
Scholarhat
 
MATATAG CURRICULUM sample lesson exemplar.docx
MATATAG CURRICULUM sample lesson exemplar.docxMATATAG CURRICULUM sample lesson exemplar.docx
MATATAG CURRICULUM sample lesson exemplar.docx
yardenmendoza
 
Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025
Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025
Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025
ALBERTHISOLER1
 
Genetics Teaching Plan: Dr.Kshirsagar R.V.
Genetics Teaching Plan: Dr.Kshirsagar R.V.Genetics Teaching Plan: Dr.Kshirsagar R.V.
Genetics Teaching Plan: Dr.Kshirsagar R.V.
DrRavindrakshirsagar1
 

Recently uploaded (20)

How to Manage Access Rights & User Types in Odoo 17
How to Manage Access Rights & User Types in Odoo 17How to Manage Access Rights & User Types in Odoo 17
How to Manage Access Rights & User Types in Odoo 17
 
E-learning Odoo 17 New features - Odoo 17 Slides
E-learning Odoo 17  New features - Odoo 17 SlidesE-learning Odoo 17  New features - Odoo 17 Slides
E-learning Odoo 17 New features - Odoo 17 Slides
 
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
 
Parent PD Design for Professional Development .docx
Parent PD Design for Professional Development .docxParent PD Design for Professional Development .docx
Parent PD Design for Professional Development .docx
 
C Interview Questions PDF By Scholarhat.pdf
C Interview Questions PDF By Scholarhat.pdfC Interview Questions PDF By Scholarhat.pdf
C Interview Questions PDF By Scholarhat.pdf
 
How To Sell Hamster Kombat Coin In Pre-market
How To Sell Hamster Kombat Coin In Pre-marketHow To Sell Hamster Kombat Coin In Pre-market
How To Sell Hamster Kombat Coin In Pre-market
 
View Inheritance in Odoo 17 - Odoo 17 Slides
View Inheritance in Odoo 17 - Odoo 17  SlidesView Inheritance in Odoo 17 - Odoo 17  Slides
View Inheritance in Odoo 17 - Odoo 17 Slides
 
JavaScript Interview Questions PDF By ScholarHat
JavaScript Interview  Questions PDF By ScholarHatJavaScript Interview  Questions PDF By ScholarHat
JavaScript Interview Questions PDF By ScholarHat
 
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptxParkinson Disease & Anti-Parkinsonian Drugs.pptx
Parkinson Disease & Anti-Parkinsonian Drugs.pptx
 
11EHS Term 3 Week 1 Unit 1 Review: Feedback and improvementpptx
11EHS Term 3 Week 1 Unit 1 Review: Feedback and improvementpptx11EHS Term 3 Week 1 Unit 1 Review: Feedback and improvementpptx
11EHS Term 3 Week 1 Unit 1 Review: Feedback and improvementpptx
 
MathematicsGrade7-Presentation-July-12024.pptx
MathematicsGrade7-Presentation-July-12024.pptxMathematicsGrade7-Presentation-July-12024.pptx
MathematicsGrade7-Presentation-July-12024.pptx
 
How to Manage Line Discount in Odoo 17 POS
How to Manage Line Discount in Odoo 17 POSHow to Manage Line Discount in Odoo 17 POS
How to Manage Line Discount in Odoo 17 POS
 
1. Importance_of_reducing_postharvest_loss.pptx
1. Importance_of_reducing_postharvest_loss.pptx1. Importance_of_reducing_postharvest_loss.pptx
1. Importance_of_reducing_postharvest_loss.pptx
 
QCE – Unpacking the syllabus Implications for Senior School practices and ass...
QCE – Unpacking the syllabus Implications for Senior School practices and ass...QCE – Unpacking the syllabus Implications for Senior School practices and ass...
QCE – Unpacking the syllabus Implications for Senior School practices and ass...
 
Codeavour 5.0 International Impact Report - The Biggest International AI, Cod...
Codeavour 5.0 International Impact Report - The Biggest International AI, Cod...Codeavour 5.0 International Impact Report - The Biggest International AI, Cod...
Codeavour 5.0 International Impact Report - The Biggest International AI, Cod...
 
DepEd School Calendar 2024-2025 DO_s2024_008
DepEd School Calendar 2024-2025 DO_s2024_008DepEd School Calendar 2024-2025 DO_s2024_008
DepEd School Calendar 2024-2025 DO_s2024_008
 
SQL Server Interview Questions PDF By ScholarHat
SQL Server Interview Questions PDF By ScholarHatSQL Server Interview Questions PDF By ScholarHat
SQL Server Interview Questions PDF By ScholarHat
 
MATATAG CURRICULUM sample lesson exemplar.docx
MATATAG CURRICULUM sample lesson exemplar.docxMATATAG CURRICULUM sample lesson exemplar.docx
MATATAG CURRICULUM sample lesson exemplar.docx
 
Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025
Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025
Brigada Eskwela 2024 PowerPoint Update for SY 2024-2025
 
Genetics Teaching Plan: Dr.Kshirsagar R.V.
Genetics Teaching Plan: Dr.Kshirsagar R.V.Genetics Teaching Plan: Dr.Kshirsagar R.V.
Genetics Teaching Plan: Dr.Kshirsagar R.V.
 

Mongodb basics and architecture

  • 2. • Written in: C++ • Data model: uses BSON (binary JSON), lightweight, traversable, efficient • Based on ‘document model’ • Use NoSQL (not only SQL), SQL is used for RDBMS • Retains some friendly properties of SQL • License: AGPL (Drivers:Apache)
  • 10. Drawbacks of such complexity  Hard to understand  Hard to add features  Inefficient
  • 11. Imagine this was done in real world
  • 12. Imagine this was done in real world
  • 13. Imagine this was done in real world
  • 14. Imagine this was done in real world
  • 15.  mongoDB takes entirely different approach  Here, Data is stored in records (called as documents)  Separate documents for each patient (example)
  • 20. Hence,  Efficient for computer to process  Natural and easy for humans to read  They can adapt
  • 21. MongoDB terminology  Databases  Collections (Table in RDBMS)  Documents (Tuple/Rows in RDBMS)
  • 22. MongoDB Distributed Systems Architecture Replication Sets  Single-master!  Maintains backup copies of database instance  Secondaries can elect a new primary within seconds if primary goes down
  • 23. Architecture Replica Set Quirks  Replicas only address durability, not ability to scale  A majority of the servers in your set must agree on the primary  Even number of servers (2) does not work
  • 24. Architecture Write process  All write operation go through primary, which applies the write operation.  Write operation then records operations on primary’s operation log “oplog”  Secondary are continuously replicating the oplog and applying the operations to themselves in an asynchronous process
  • 25. Architecture Workloads Isolation  Combines different classes of workload
  • 26. Architecture Sharding  To meet the needs of app with large data sets and high throughput requirements
  • 27. Architecture Sharding  Mongos talks to exactly three Config server
  • 28. Architecture Sharding Quirks  If any one config serves goes down, your entire database goes down.  Auto-sharding sometimes doesn’t work.
  • 29. Architecture Data Locality  MongoDB zoned sharding allows precise control over where data is physically stored in a cluster.  Enables developers- data placement by geographic region  Developer can assign each shard to a zone representing the physical location.  Any number of shards can be associated with each zone, and each zone can be scaled independently of the other
  • 30. Architecture Data Security  Authentication  Offers integration with external security mechanisms including Windows Active Directory, Kerberos, etc.  Authorization  Enable to configure granular permission for user  Auditing  provide native audit log to track any DB operations  Encryption  On networks, on disk and in backups
  • 31. Architecture Freedom to Run Anywhere  Many companies moving to public cloud  MongoDB allows organizations to adopt cloud at their own pace by moving select workloads as needed.  For example, They may run the same workload in a hybrid environment to manage sudden peaks in demand, or use the cloud to launch services in regions where they lack a physical data center presence.
  • 32. Advantages over RDBMS  Schema less  Deep query ability  Ease of scale-out  Structure of single object is clear  Uses internal memory for storing the working set, enabling faster access of data  Mapping of application objects to database objects is not needed
  • 33. Why use MongoDB?  Document Oriented Storage  Index on any attribute  Replication and high availability  Auto-sharding  Rich queries  Built-in aggregation capabilities, MapReduce, GridFS  Professional support by MongoDB
  • 34. Where to use MongoDB?  Big Data  Content Management and Delivery  Mobile and Social infrastructure  User Data Management  Data Hub
  • 35. References-  https://www.mongodb.com/what-is-mongodb Mongodb Architectural Guide  https://www.tutorialspoint.com/mongodb/ MongoDB Tutorials – TutorialsPoints  Understanding mongodb, by Frank Kane - Youtube video  MongoDB in 5 minutes with Eliot Horowitz – Youtube video

Editor's Notes

  1. MongoDB is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. MongoDB is developed by MongoDB Inc., and is published under a combination of the GNU Affero General Public License and the Apache License.
  2. SQL- Structure Query Language, RDBMS- data is stored in table(relation) and tuples in table
  3. -Lets take an example of RDBMS (Relational Database Management system) -Consider database of a hospital
  4. -You can see how it get out of hands quickly -This is exactly how developers work with data in Relational Databases -so the record of single patient is spreadout in such dozens of table. This adds massive amount of complexity to the application
  5. Due to this complexity -hard for people maintaining application to understand -it makes adding feature harder, because there are so much more to account for -pulling data from so many places in inefficient
  6. -Doctors have to pull out every drawer to get the complete information of a single patient -Here each cabinet represents ‘Table’ in RDBMS
  7. -Doctors have to pull out every drawer to get the complete information of a single patient
  8. -Doctors have to pull out every drawer to get the complete information of a single patient
  9. -Doctors have to pull out every drawer to get the complete information of a single patient -You can see how complicated, error prone and slow that will be
  10. Document of One patient
  11. Document of another patient. -Different amount of data for two consecutive patient document Eg. One has email address, another doesnot
  12. Document of three patients having different number of columns of information
  13. All three document are stored in one cabinet
  14. -Developer do not have to make their application accommodates the need of database anymore mongoDB accommodates them, so their application can store data in a natural way -It also means they can adapt, add a new thing without worrying that a simple change can break everything
  15. -Collection- can contain pretty much anythings Restriction: You can’ t move data across collections between different databases
  16. -Beyond using replication for redundancy and availability, replica sets also provide a foundation for combing different classes of workload on the same MongoDB cluster, each operating against its own copy of the data. -With workload isolation, business analysts can run exploratory queries and generate reports, and data scientists can build machine learning models without impacting operational applications -With the operational and analytic workloads isolated from one another on different replica set nodes, they never contend for resouces.
  17. -MongoDB provides horizontal scale-out for databases on low-cost, commodity hardware or cloud infrastructure using the technique called sharding. -Each shard is backed by a replica set to provide always-on availability and workload isolation. -Sharding allows developers to seamlessly scale the database as their apps grows beyond the hardware limits of a single server, and it does this without adding complexity to the application. Sharding is transparent to applications; whether there is one or a thousand shards, the application code for querying MongoDB remains the same
  18. Config server- knows about how things are partitioned and then use that figure out which replica set that mongos talk to to get the information that mongos want Config server run on top of the single-master design of replica sets Horizontal scaling: Scaling by adding more machines into your pool of resouces Vertical scaling: you scale by adding more power (CPU, RAM) to your existing machine
  19. Sharding types: Ranged Sharding, Hashed Sharding, Zoned Sharding 2-Data placement by geographic region for latency and governance requirements 3- Physical location (North America, Europe or China) of that shard’s servers and then map all documents to the correct zone based on its region field. 4- For instance, accommodating faster user growth in China than North America
  20. Having freedom to put data anywhere for developers, they must also be confident that their data is secure, wherever it is stored. Rather than build security controls back in the application, they should be able to rely on the database to implement the mechanisms needed to protect sensitive data and meet the needs of apps in regulated industries. MongoDB features extensive capabilities to defend, detect, and control access to data
  21. 1. to not only reduce the operational overhead of managing infrastructure, but also provide their teams with on-demand services that make it easier to build and run and application backend
  22. -MongoDB is document database in which one collection holds different documents. Number of fields, content and size of the document can differ from one document to another. -MongoDB supports dynamic queries on documents using document-based query language that’s nearly as powerful as SQL -
  23. -For some applications you might not need Hadoop at all -But MongoDB still integrates with Hadoop, Spark and most language -GridFs=> kind of like HDFS
  24. MongoDB is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. MongoDB is developed by MongoDB Inc., and is published under a combination of the GNU Affero General Public License and the Apache License.