SlideShare ist ein Scribd-Unternehmen logo
1 von 36
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

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Mongo DB Presentation
Mongo DB PresentationMongo DB Presentation
Mongo DB Presentation
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
 
Introduction to mongodb
Introduction to mongodbIntroduction to mongodb
Introduction to mongodb
 
Non relational databases-no sql
Non relational databases-no sqlNon relational databases-no sql
Non relational databases-no sql
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
 
NoSql
NoSqlNoSql
NoSql
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
An Enterprise Architect's View of MongoDB
An Enterprise Architect's View of MongoDBAn Enterprise Architect's View of MongoDB
An Enterprise Architect's View of MongoDB
 
MongoDB Fundamentals
MongoDB FundamentalsMongoDB Fundamentals
MongoDB Fundamentals
 
Indexing with MongoDB
Indexing with MongoDBIndexing with MongoDB
Indexing with MongoDB
 
NOSQL and MongoDB Database
NOSQL and MongoDB DatabaseNOSQL and MongoDB Database
NOSQL and MongoDB Database
 
NoSQL databases - An introduction
NoSQL databases - An introductionNoSQL databases - An introduction
NoSQL databases - An introduction
 
Copy of MongoDB .pptx
Copy of MongoDB .pptxCopy of MongoDB .pptx
Copy of MongoDB .pptx
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 

Ähnlich wie Mongodb basics and architecture

Mongo presentation conf
Mongo presentation confMongo presentation conf
Mongo presentation conf
Shridhar Joshi
 

Ähnlich wie 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
 

Kürzlich hochgeladen

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 

Kürzlich hochgeladen (20)

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

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

Hinweis der Redaktion

  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.