SlideShare a Scribd company logo
1 of 20
Download to read offline
Introduction to
MongoDB
Faro Dev Day 16
Mwai Karimi
@openbk
/kmwai
Agenda
Intro
Concepts & Rationale
● What is Mongodb, evolution,
Key Features
● Internals, crud operations, data management, security, provisioning and
disaster recovery
About me
Student
Web developer, tech enthusiast
Ardent foodie, travel junkie
Passionate about women empowerment & History
Concepts & Rationale
● Hardware - Parallelism (cores / servers / Cloud Computing / Distributed
computing)
● Scale up -> “Big data”
● Make app dev easier & elegant
○ Complex structure, unstructured, polymorphic
Scaling / dev Speed / Complex data
Scale Out
What is MongoDB
• Scalable High-Performance Open-source, Document-oriented 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.
Support for multiple storage engines
Why Documents?
● Documents (i.e. objects) correspond to native data types in many
programming languages.
● Embedded documents and arrays reduce need for expensive joins.
● Dynamic schema supports fluent polymorphism.
Driver support
C, C++, Java, PHP, Python, Node, Pearl, Ruby, Motor, Erlang
Internals
Database - database
● Made up of multiple collections
● Created on the fly when referenced for the first time
Collection - Table
● Schemaless - Contains documents
● Indexable
● Created on the fly when referenced
Document - Row
● Stored in a collection
● Have _id - similar to primary keys
● Supports Relationships (embedded / referenced)
● Stored in BSON (Binary JSON)
internals
Restrictions
● 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 dollar sign ($) character.
● The field names cannot contain the dot (.) character.
● The field names cannot contain the null character.
CRUD Operations
Create - Create or insert operations add new documents to a collection. If the
collection does not currently exist, insert operations will create the collection.
MongoDB provides the following methods to insert documents into a collection:
● db.collection.insert()
● db.collection.insertOne() New in version 3.2
● db.collection.insertMany() New in version 3.2
CRUD Operations
Read operations retrieves documents from a collection; i.e. queries a collection for
documents. MongoDB provides the following methods to read documents from a
collection:
● db.collection.find()
CRUD Operations
Update operations modify existing documents in a collection. MongoDB provides
the following methods to update documents of a collection:
● db.collection.update()
● db.collection.updateOne() New in version 3.2
● db.collection.updateMany() New in version 3.2
● db.collection.replaceOne() New in version 3.2
CRUD Operations
Delete operations remove documents from a collection. MongoDB provides the
following methods to delete documents of a collection:
● db.collection.remove()
● db.collection.deleteOne() New in version 3.2
● db.collection.deleteMany() New in version 3.2
Data Management
● Auto-Sharding (sharding) - automatically balances the data in the sharded
cluster as the data grows or the size of the cluster increases or decreases.
○ Range based - docs partitioned across shards according to the shard key value
○ Hash based - “ “ according to the MD5 hash of the shard key value
○ Zone Sharding - provides dba & ops teams w/ opportunities to define rules governing data
placement in a sharded cluster
● Availability - through Replication (replica sets)
○ Replica failover fully automated
○ No. of replica sets fully configurable (up to 50) - allows for data durability in case of failures
○ Replica sets allow for operational flexibility - db does not need to be taken offline
○ Allows for tunable consistency - apps reading from secondaries (data is consistent by default)
Security
● Authentication - integration w/ LDAP, Kerberos
● Authorisation - admins can define user-based roles
● Auditing - audit log to track any op taken against the db
● Encryption - Data can be encrypted on the network, disk & in back ups
Provisioning, Monitoring and Disaster Recovery
Made possible by the Mongodb Ops Manager
● Deployment - Any topology, at any scale
● Upgrade - In minutes, with no downtime
● Scale - Add capacity, without taking the application offline
● Visualize - Graphically display query performance to identify and fix slow
running operations
● Point-in-time, Scheduled backups - restore complete running clusters to
any point in time with just a few clicks, because disasters aren't predictable
● Performance Alerts - Monitor 100+ system metrics and get custom alerts
before the system degrades.
MongoDB Atlas
DB as a service
Automated operations - deploy in minutes
Elastic - easy to scale up or out
Performance metrics in real time
Resources
Case studies - (mongodb.com/customers)
Documentation - (docs.mongodb.com)
MongoDB Enterprise download - mongodb.com/download
MongoDB Atlas - (mongodb.com/cloud/atlas)

More Related Content

What's hot

Putting rails and couch db on the cloud - Indicthreads cloud computing confe...
Putting rails and couch db on the cloud -  Indicthreads cloud computing confe...Putting rails and couch db on the cloud -  Indicthreads cloud computing confe...
Putting rails and couch db on the cloud - Indicthreads cloud computing confe...
IndicThreads
 
Mongo presentation conf
Mongo presentation confMongo presentation conf
Mongo presentation conf
Shridhar Joshi
 
Zero to 1 Billion+ Records: A True Story of Learning & Scaling GameChanger
Zero to 1 Billion+ Records: A True Story of Learning & Scaling GameChangerZero to 1 Billion+ Records: A True Story of Learning & Scaling GameChanger
Zero to 1 Billion+ Records: A True Story of Learning & Scaling GameChanger
MongoDB
 

What's hot (20)

Clique square storage
Clique square storageClique square storage
Clique square storage
 
Large-scale projects development (scaling LAMP)
Large-scale projects development (scaling LAMP)Large-scale projects development (scaling LAMP)
Large-scale projects development (scaling LAMP)
 
MongoDb - Details on the POC
MongoDb - Details on the POCMongoDb - Details on the POC
MongoDb - Details on the POC
 
Cassandra Lunch #59 Functions in Cassandra
Cassandra Lunch #59  Functions in CassandraCassandra Lunch #59  Functions in Cassandra
Cassandra Lunch #59 Functions in Cassandra
 
What Reika Taught us
What Reika Taught usWhat Reika Taught us
What Reika Taught us
 
Lcna example-2012
Lcna example-2012Lcna example-2012
Lcna example-2012
 
Dynamo db and Cross Region Migration
Dynamo db and Cross Region MigrationDynamo db and Cross Region Migration
Dynamo db and Cross Region Migration
 
Putting rails and couch db on the cloud - Indicthreads cloud computing confe...
Putting rails and couch db on the cloud -  Indicthreads cloud computing confe...Putting rails and couch db on the cloud -  Indicthreads cloud computing confe...
Putting rails and couch db on the cloud - Indicthreads cloud computing confe...
 
Mongo presentation conf
Mongo presentation confMongo presentation conf
Mongo presentation conf
 
Zero to 1 Billion+ Records: A True Story of Learning & Scaling GameChanger
Zero to 1 Billion+ Records: A True Story of Learning & Scaling GameChangerZero to 1 Billion+ Records: A True Story of Learning & Scaling GameChanger
Zero to 1 Billion+ Records: A True Story of Learning & Scaling GameChanger
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
 
BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013BaseX user-group-talk XML Prague 2013
BaseX user-group-talk XML Prague 2013
 
.NET Memory Primer (Martin Kulov)
.NET Memory Primer (Martin Kulov).NET Memory Primer (Martin Kulov)
.NET Memory Primer (Martin Kulov)
 
Improve Presto Architectural Decisions with Shadow Cache
 Improve Presto Architectural Decisions with Shadow Cache Improve Presto Architectural Decisions with Shadow Cache
Improve Presto Architectural Decisions with Shadow Cache
 
Gsummit apis-2013
Gsummit apis-2013Gsummit apis-2013
Gsummit apis-2013
 
Updating materialized views and caches using kafka
Updating materialized views and caches using kafkaUpdating materialized views and caches using kafka
Updating materialized views and caches using kafka
 
21st Athens Big Data Meetup - 1st Talk - Fast and simple data exploration wit...
21st Athens Big Data Meetup - 1st Talk - Fast and simple data exploration wit...21st Athens Big Data Meetup - 1st Talk - Fast and simple data exploration wit...
21st Athens Big Data Meetup - 1st Talk - Fast and simple data exploration wit...
 
MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011
 
Features of couchDB
Features of couchDBFeatures of couchDB
Features of couchDB
 
Distcp gobblin
Distcp gobblinDistcp gobblin
Distcp gobblin
 

Similar to Introduction to mongo db

Accra MongoDB User Group
Accra MongoDB User GroupAccra MongoDB User Group
Accra MongoDB User Group
MongoDB
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
Krivoy Rog IT Community
 
Google Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 DayGoogle Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 Day
programmermag
 

Similar to Introduction to mongo db (20)

Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDB
 
MongoDB World 2019: Packing Up Your Data and Moving to MongoDB Atlas
MongoDB World 2019: Packing Up Your Data and Moving to MongoDB AtlasMongoDB World 2019: Packing Up Your Data and Moving to MongoDB Atlas
MongoDB World 2019: Packing Up Your Data and Moving to MongoDB Atlas
 
MongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseMongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL Database
 
Mongodb
MongodbMongodb
Mongodb
 
mongodb tutorial
mongodb tutorialmongodb tutorial
mongodb tutorial
 
MongoDB World 2018: Solving Your Backup Needs Using MongoDB Ops Manager, Clou...
MongoDB World 2018: Solving Your Backup Needs Using MongoDB Ops Manager, Clou...MongoDB World 2018: Solving Your Backup Needs Using MongoDB Ops Manager, Clou...
MongoDB World 2018: Solving Your Backup Needs Using MongoDB Ops Manager, Clou...
 
Accra MongoDB User Group
Accra MongoDB User GroupAccra MongoDB User Group
Accra MongoDB User Group
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDB
 
SQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDBSQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDB
 
Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
 
Mongodb
MongodbMongodb
Mongodb
 
The Accidental DBA
The Accidental DBAThe Accidental DBA
The Accidental DBA
 
Introduction to Apache Airflow
Introduction to Apache AirflowIntroduction to Apache Airflow
Introduction to Apache Airflow
 
MongoDB performance tuning and load testing, NOSQL Now! 2013 Conference prese...
MongoDB performance tuning and load testing, NOSQL Now! 2013 Conference prese...MongoDB performance tuning and load testing, NOSQL Now! 2013 Conference prese...
MongoDB performance tuning and load testing, NOSQL Now! 2013 Conference prese...
 
Google Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 DayGoogle Cloud Computing on Google Developer 2008 Day
Google Cloud Computing on Google Developer 2008 Day
 
MongoDB Pros and Cons
MongoDB Pros and ConsMongoDB Pros and Cons
MongoDB Pros and Cons
 
Designing for operability and managability
Designing for operability and managabilityDesigning for operability and managability
Designing for operability and managability
 
What is the significance of MongoDB and what are its usages.docx
What is the significance of MongoDB and what are its usages.docxWhat is the significance of MongoDB and what are its usages.docx
What is the significance of MongoDB and what are its usages.docx
 
6 Months Sailing with Docker in Production
6 Months Sailing with Docker in Production 6 Months Sailing with Docker in Production
6 Months Sailing with Docker in Production
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Introduction to mongo db

  • 1. Introduction to MongoDB Faro Dev Day 16 Mwai Karimi @openbk /kmwai
  • 2. Agenda Intro Concepts & Rationale ● What is Mongodb, evolution, Key Features ● Internals, crud operations, data management, security, provisioning and disaster recovery
  • 3. About me Student Web developer, tech enthusiast Ardent foodie, travel junkie Passionate about women empowerment & History
  • 4. Concepts & Rationale ● Hardware - Parallelism (cores / servers / Cloud Computing / Distributed computing) ● Scale up -> “Big data” ● Make app dev easier & elegant ○ Complex structure, unstructured, polymorphic Scaling / dev Speed / Complex data
  • 6. What is MongoDB • Scalable High-Performance Open-source, Document-oriented 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. Support for multiple storage engines
  • 7. Why Documents? ● Documents (i.e. objects) correspond to native data types in many programming languages. ● Embedded documents and arrays reduce need for expensive joins. ● Dynamic schema supports fluent polymorphism.
  • 8.
  • 9. Driver support C, C++, Java, PHP, Python, Node, Pearl, Ruby, Motor, Erlang
  • 10. Internals Database - database ● Made up of multiple collections ● Created on the fly when referenced for the first time Collection - Table ● Schemaless - Contains documents ● Indexable ● Created on the fly when referenced Document - Row ● Stored in a collection ● Have _id - similar to primary keys ● Supports Relationships (embedded / referenced) ● Stored in BSON (Binary JSON)
  • 11. internals Restrictions ● 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 dollar sign ($) character. ● The field names cannot contain the dot (.) character. ● The field names cannot contain the null character.
  • 12. CRUD Operations Create - Create or insert operations add new documents to a collection. If the collection does not currently exist, insert operations will create the collection. MongoDB provides the following methods to insert documents into a collection: ● db.collection.insert() ● db.collection.insertOne() New in version 3.2 ● db.collection.insertMany() New in version 3.2
  • 13. CRUD Operations Read operations retrieves documents from a collection; i.e. queries a collection for documents. MongoDB provides the following methods to read documents from a collection: ● db.collection.find()
  • 14. CRUD Operations Update operations modify existing documents in a collection. MongoDB provides the following methods to update documents of a collection: ● db.collection.update() ● db.collection.updateOne() New in version 3.2 ● db.collection.updateMany() New in version 3.2 ● db.collection.replaceOne() New in version 3.2
  • 15. CRUD Operations Delete operations remove documents from a collection. MongoDB provides the following methods to delete documents of a collection: ● db.collection.remove() ● db.collection.deleteOne() New in version 3.2 ● db.collection.deleteMany() New in version 3.2
  • 16. Data Management ● Auto-Sharding (sharding) - automatically balances the data in the sharded cluster as the data grows or the size of the cluster increases or decreases. ○ Range based - docs partitioned across shards according to the shard key value ○ Hash based - “ “ according to the MD5 hash of the shard key value ○ Zone Sharding - provides dba & ops teams w/ opportunities to define rules governing data placement in a sharded cluster ● Availability - through Replication (replica sets) ○ Replica failover fully automated ○ No. of replica sets fully configurable (up to 50) - allows for data durability in case of failures ○ Replica sets allow for operational flexibility - db does not need to be taken offline ○ Allows for tunable consistency - apps reading from secondaries (data is consistent by default)
  • 17. Security ● Authentication - integration w/ LDAP, Kerberos ● Authorisation - admins can define user-based roles ● Auditing - audit log to track any op taken against the db ● Encryption - Data can be encrypted on the network, disk & in back ups
  • 18. Provisioning, Monitoring and Disaster Recovery Made possible by the Mongodb Ops Manager ● Deployment - Any topology, at any scale ● Upgrade - In minutes, with no downtime ● Scale - Add capacity, without taking the application offline ● Visualize - Graphically display query performance to identify and fix slow running operations ● Point-in-time, Scheduled backups - restore complete running clusters to any point in time with just a few clicks, because disasters aren't predictable ● Performance Alerts - Monitor 100+ system metrics and get custom alerts before the system degrades.
  • 19. MongoDB Atlas DB as a service Automated operations - deploy in minutes Elastic - easy to scale up or out Performance metrics in real time
  • 20. Resources Case studies - (mongodb.com/customers) Documentation - (docs.mongodb.com) MongoDB Enterprise download - mongodb.com/download MongoDB Atlas - (mongodb.com/cloud/atlas)