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

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

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)