SlideShare a Scribd company logo
Introduction to MongoDB
Matthew Bates
Solution Architect
MongoDB EMEA
2
MongoDB
The leading NoSQL database
Document
Database
Open-
Source
General
Purpose
3
Relational Database Challenges
Data Types
•  Unstructured data
•  Semi-structured
data
•  Polymorphic data
Volume of Data
•  Petabytes of data
•  Trillions of records
•  Millions of queries per
second
Agile Development
•  Iterative
•  Short development
cycles
•  New workloads
New Architectures
•  Horizontal scaling
•  Commodity servers
•  Cloud computing
4
Document Data Model
Relational - Tables
{ first_name: ‘Paul’,!
surname: ‘Miller’,!
city: ‘London’,!
location: {!
!type: “Point”,
!coordinates :!
! ![-0.128, 51.507]!
!},!
cars: [ !
{ model: ‘Bentley’,!
year: 1973,!
value: 100000, … },!
{ model: ‘Rolls Royce’,!
year: 1965,!
value: 330000, … }!
}!
}!
Document - Collections
5
Dynamic Schema Documents
name: “jeff”,
eyes: “blue”,
height: 72,
boss: “ben”}
{name: “brendan”,
aliases: [“el diablo”]}
name: “ben”,
hat: ”yes”}
{name: “matt”,
pizza: “DiGiorno”,
height: 72,
boss: 555.555.1212}
{name: “will”,
eyes: “blue”,
birthplace: “NY”,
aliases: [“bill”, “la
ciacco”],
gender: ”???”,
boss: ”ben”}
6
Document Model
•  Agility and flexibility – dynamic schema
–  Data models can evolve easily
–  Companies can adapt to changes quickly
•  Intuitive, natural data representation
–  Remove impedance mismatch
–  Many types of applications are a good fit
•  Reduces the need for joins, disk seeks
–  Programming is more simple
–  Performance can be delivered at scale
7
Simplify Development
8
Simplify Development
9
Rich Database Interaction
10
MongoDB: An Operational Database
11
Shell
Command-line shell for
interacting directly with
database
Shell and Drivers
Drivers
Drivers for most popular
programming languages and
frameworks
> db.collection.insert({company:“10gen”,
product:“MongoDB”})
>
> db.collection.findOne()
{
“_id” : ObjectId(“5106c1c2fc629bfe52792e86”),
“company” : “10gen”
“product” : “MongoDB”
}
Java
Python
Perl
Ruby
Haskell
JavaScript
12
•  Ad-hoc queries
•  Real-time aggregation
•  Rich query capabilities
•  Index support - secondary, compound, text, geo
and more
•  Strong (traditional) consistency
•  Geospatial features
•  Support for most programming languages
•  Flexible schema
MongoDB is Full Featured
13
Features In Practice
Queries
•  Find Paul’s cars
•  Find everybody in London with a car
built between 1970 and 1980
Geospatial
•  Find all of the car owners within 5km of
Trafalgar Sq.
Text Search
•  Find all the cars described as having
leather seats
Aggregation
•  Calculate the average value of Paul’s
car collection
Map Reduce
•  What is the ownership pattern of colors
by geography over time? (is purple
trending up in China?)
{ first_name: ‘Paul’,!
surname: ‘Miller’,!
city: ‘London’,!
location: {!
!type: “Point”,
!coordinates :!
! ![-0.128, 51.507]!
!},!
cars: [ !
{ model: ‘Bentley’,!
year: 1973,!
value: 100000, … },!
{ model: ‘Rolls Royce’,!
year: 1965,!
value: 330000, … }!
}!
}!
14
Query Example
Rich Queries
•  Find Paul’s cars
•  Find everybody in London with a car
built between 1970 and 1980
db.cars.find({
first_name: ‘Paul’!
})
db.cars.find({
!city: ‘London’,
”cars.year" : {
$gte : 1970,
$lte : 1980
}
})
!
{ first_name: ‘Paul’,!
surname: ‘Miller’,!
city: ‘London’,!
location: {!
!type: “Point”,
!coordinates :!
! ![-0.128, 51.507]!
!},!
cars: [ !
{ model: ‘Bentley’,!
year: 1973,!
value: 100000, … },!
{ model: ‘Rolls Royce’,!
year: 1965,!
value: 330000, … }!
}!
}!
15
Geo Spatial Example
db.cars.find( {
location:
{ $near :
{ $geometry :
{ type: 'Point' ,
coordinates :
[-0.128,51.507]
}
},
$maxDistance :5000
}
} )
!
Geospatial
•  Find all of the car owners within 5km of
Trafalgar Sq.
{ first_name: ‘Paul’,!
surname: ‘Miller’,!
city: ‘London’,!
location: {!
!type: “Point”,
!coordinates :!
! ![-0.128, 51.507]!
!},!
cars: [ !
{ model: ‘Bentley’,!
year: 1973,!
value: 100000, … },!
{ model: ‘Rolls Royce’,!
year: 1965,!
value: 330000, … }!
}!
}!
16
Aggregation Framework Example
db.cars.aggregate( [
{$match : {"first_name" : "Paul"}},
{$project : {"first_name":1,"cars":1}},
{$unwind : "$cars"},
{ $group : {_id:"$first_name",
average : {
$avg : "$cars.value"}}}
])
{ "_id" : "Paul", "average" : 215000 }
!
Aggregation
•  Calculate the average value of Paul’s
car collection
{ first_name: ‘Paul’,!
surname: ‘Miller’,!
city: ‘London’,!
location: {!
!type: “Point”,
!coordinates :!
! ![-0.128, 51.507]!
!},!
cars: [ !
{ model: ‘Bentley’,!
year: 1973,!
value: 100000, … },!
{ model: ‘Rolls Royce’,!
year: 1965,!
value: 330000, … }!
}!
}!
Scalability
18
Automatic Sharding
•  Three types of sharding: hash-based, range-based, tag-
aware
•  Increase or decrease capacity as you go
•  Automatic balancing
19
Query Routing
•  Multiple query optimization models
•  Each sharding option appropriate for different apps
Availability
21
Replica Sets
•  Replica Set – two or more copies
•  “Self-healing” shard
•  Addresses many concerns:
-  High Availability
-  Disaster Recovery
-  Maintenance
22
Replica Set Benefits
Business Needs Replica Set Benefits
High Availability Automated failover
Disaster Recovery Hot backups offsite
Maintenance Rolling upgrades
Low Latency Locate data near users
Workload Isolation Read from non-primary replicas
Data Privacy Restrict data to physical location
Data Consistency Tunable Consistency
Performance
24
Better Data
Locality
Performance
In-Memory
Caching
In-Place
Updates
25
Disk Seeks and Data Locality
Seek = 5+ ms Read = really really fast
User
Comment
Article
26
Disk Seeks and Data Locality
Article
User
CommentCommentCommentCommentComment
Use Cases
28
MongoDB Use Cases
Big Data Product & Asset
Catalogs
Security &
Fraud
Internet of
Things
Database-as-a-
Service
Mobile
Apps
Customer Data
Management
Data
Hub
Social &
Collaboration
Content
Management
Intelligence Agencies
Top Investment and
Retail Banks
Top US Retailer
Top Global Shipping
Company
Top Industrial Equipment
Manufacturer
Top Media Company
Top Investment and
Retail Banks
29
•  Document Model
–  Simplify development
–  Simplify scale out
–  Improve performance
•  MongoDB – leading NoSQL database
–  Rich general purpose database
–  Fully featured
–  Built-in HA (High Availability) and automated failover
–  Built-in horizontal scale-out
Summary
30
Getting Started
http://www.mongodb.org/downloads
31
Online Documentation
http://docs.mongodb.org
32
MongoDB University
http://university.mongodb.com
33
For More Information
Resource Location
MongoDB Downloads mongodb.com/download
Free Online Training education.mongodb.com
Webinars and Events mongodb.com/events
White Papers mongodb.com/white-papers
Case Studies mongodb.com/customers
Presentations mongodb.com/presentations
Documentation docs.mongodb.org
Additional Info info@mongodb.com
Resource Location
An Introduction to Mongo DB

More Related Content

Similar to An Introduction to Mongo DB

Neotys conference
Neotys conferenceNeotys conference
Neotys conference
Tugdual Grall
 
The Right (and Wrong) Use Cases for MongoDB
The Right (and Wrong) Use Cases for MongoDBThe Right (and Wrong) Use Cases for MongoDB
The Right (and Wrong) Use Cases for MongoDB
MongoDB
 
MongoDB Workshop Sophia Conf 2018
MongoDB Workshop Sophia Conf 2018MongoDB Workshop Sophia Conf 2018
MongoDB Workshop Sophia Conf 2018
Maxime Beugnet
 
tranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And When
tranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And WhentranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And When
tranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And When
David Peyruc
 
Webinar: General Technical Overview of MongoDB for Ops Teams
Webinar: General Technical Overview of MongoDB for Ops TeamsWebinar: General Technical Overview of MongoDB for Ops Teams
Webinar: General Technical Overview of MongoDB for Ops Teams
MongoDB
 
MongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
MongoDB Evenings DC: MongoDB - The New Default Database for Giant IdeasMongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
MongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
MongoDB
 
Jumpstart! Building Your First MongoDB App Using Atlas & Stitch
Jumpstart! Building Your First MongoDB App Using Atlas & StitchJumpstart! Building Your First MongoDB App Using Atlas & Stitch
Jumpstart! Building Your First MongoDB App Using Atlas & Stitch
Lauren Hayward Schaefer
 
Building your First MEAN App
Building your First MEAN AppBuilding your First MEAN App
Building your First MEAN App
MongoDB
 
Jumpstart! From SQL to NoSQL -- Changing Your Mindset
Jumpstart! From SQL to NoSQL -- Changing Your MindsetJumpstart! From SQL to NoSQL -- Changing Your Mindset
Jumpstart! From SQL to NoSQL -- Changing Your Mindset
Lauren Hayward Schaefer
 
MongoDB: Back to Basics
MongoDB:  Back to BasicsMongoDB:  Back to Basics
MongoDB: Back to Basics
Lauren Hayward Schaefer
 
MongoDB Schema Design
MongoDB Schema DesignMongoDB Schema Design
MongoDB Schema Design
Joe Drumgoole
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
Joe Drumgoole
 
Intro to MongoDB (Extended Session)
Intro to MongoDB (Extended Session)Intro to MongoDB (Extended Session)
Intro to MongoDB (Extended Session)
All Things Open
 
MongoDB .local Houston 2019: Jumpstart: From SQL to NoSQL -- Changing Your Mi...
MongoDB .local Houston 2019: Jumpstart: From SQL to NoSQL -- Changing Your Mi...MongoDB .local Houston 2019: Jumpstart: From SQL to NoSQL -- Changing Your Mi...
MongoDB .local Houston 2019: Jumpstart: From SQL to NoSQL -- Changing Your Mi...
MongoDB
 
Intro to MongoDB Workshop
Intro to MongoDB WorkshopIntro to MongoDB Workshop
Intro to MongoDB Workshop
Lauren Hayward Schaefer
 
MongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your MindsetMongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
OrientDB - cloud barcamp Libero Cloud
OrientDB - cloud barcamp Libero CloudOrientDB - cloud barcamp Libero Cloud
OrientDB - cloud barcamp Libero Cloud
Luigi Dell'Aquila
 
Python Ireland Conference 2016 - Python and MongoDB Workshop
Python Ireland Conference 2016 - Python and MongoDB WorkshopPython Ireland Conference 2016 - Python and MongoDB Workshop
Python Ireland Conference 2016 - Python and MongoDB Workshop
Joe Drumgoole
 
The openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageThe openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query Language
Neo4j
 
Retail referencearchitecture productcatalog
Retail referencearchitecture productcatalogRetail referencearchitecture productcatalog
Retail referencearchitecture productcatalog
MongoDB
 

Similar to An Introduction to Mongo DB (20)

Neotys conference
Neotys conferenceNeotys conference
Neotys conference
 
The Right (and Wrong) Use Cases for MongoDB
The Right (and Wrong) Use Cases for MongoDBThe Right (and Wrong) Use Cases for MongoDB
The Right (and Wrong) Use Cases for MongoDB
 
MongoDB Workshop Sophia Conf 2018
MongoDB Workshop Sophia Conf 2018MongoDB Workshop Sophia Conf 2018
MongoDB Workshop Sophia Conf 2018
 
tranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And When
tranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And WhentranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And When
tranSMART Community Meeting 5-7 Nov 13 - Session 2: MongoDB: What, Why And When
 
Webinar: General Technical Overview of MongoDB for Ops Teams
Webinar: General Technical Overview of MongoDB for Ops TeamsWebinar: General Technical Overview of MongoDB for Ops Teams
Webinar: General Technical Overview of MongoDB for Ops Teams
 
MongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
MongoDB Evenings DC: MongoDB - The New Default Database for Giant IdeasMongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
MongoDB Evenings DC: MongoDB - The New Default Database for Giant Ideas
 
Jumpstart! Building Your First MongoDB App Using Atlas & Stitch
Jumpstart! Building Your First MongoDB App Using Atlas & StitchJumpstart! Building Your First MongoDB App Using Atlas & Stitch
Jumpstart! Building Your First MongoDB App Using Atlas & Stitch
 
Building your First MEAN App
Building your First MEAN AppBuilding your First MEAN App
Building your First MEAN App
 
Jumpstart! From SQL to NoSQL -- Changing Your Mindset
Jumpstart! From SQL to NoSQL -- Changing Your MindsetJumpstart! From SQL to NoSQL -- Changing Your Mindset
Jumpstart! From SQL to NoSQL -- Changing Your Mindset
 
MongoDB: Back to Basics
MongoDB:  Back to BasicsMongoDB:  Back to Basics
MongoDB: Back to Basics
 
MongoDB Schema Design
MongoDB Schema DesignMongoDB Schema Design
MongoDB Schema Design
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
Intro to MongoDB (Extended Session)
Intro to MongoDB (Extended Session)Intro to MongoDB (Extended Session)
Intro to MongoDB (Extended Session)
 
MongoDB .local Houston 2019: Jumpstart: From SQL to NoSQL -- Changing Your Mi...
MongoDB .local Houston 2019: Jumpstart: From SQL to NoSQL -- Changing Your Mi...MongoDB .local Houston 2019: Jumpstart: From SQL to NoSQL -- Changing Your Mi...
MongoDB .local Houston 2019: Jumpstart: From SQL to NoSQL -- Changing Your Mi...
 
Intro to MongoDB Workshop
Intro to MongoDB WorkshopIntro to MongoDB Workshop
Intro to MongoDB Workshop
 
MongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your MindsetMongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local Chicago 2019: From SQL to NoSQL -- Changing Your Mindset
 
OrientDB - cloud barcamp Libero Cloud
OrientDB - cloud barcamp Libero CloudOrientDB - cloud barcamp Libero Cloud
OrientDB - cloud barcamp Libero Cloud
 
Python Ireland Conference 2016 - Python and MongoDB Workshop
Python Ireland Conference 2016 - Python and MongoDB WorkshopPython Ireland Conference 2016 - Python and MongoDB Workshop
Python Ireland Conference 2016 - Python and MongoDB Workshop
 
The openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageThe openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query Language
 
Retail referencearchitecture productcatalog
Retail referencearchitecture productcatalogRetail referencearchitecture productcatalog
Retail referencearchitecture productcatalog
 

Recently uploaded

RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 

Recently uploaded (20)

RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 

An Introduction to Mongo DB

  • 1. Introduction to MongoDB Matthew Bates Solution Architect MongoDB EMEA
  • 2. 2 MongoDB The leading NoSQL database Document Database Open- Source General Purpose
  • 3. 3 Relational Database Challenges Data Types •  Unstructured data •  Semi-structured data •  Polymorphic data Volume of Data •  Petabytes of data •  Trillions of records •  Millions of queries per second Agile Development •  Iterative •  Short development cycles •  New workloads New Architectures •  Horizontal scaling •  Commodity servers •  Cloud computing
  • 4. 4 Document Data Model Relational - Tables { first_name: ‘Paul’,! surname: ‘Miller’,! city: ‘London’,! location: {! !type: “Point”, !coordinates :! ! ![-0.128, 51.507]! !},! cars: [ ! { model: ‘Bentley’,! year: 1973,! value: 100000, … },! { model: ‘Rolls Royce’,! year: 1965,! value: 330000, … }! }! }! Document - Collections
  • 5. 5 Dynamic Schema Documents name: “jeff”, eyes: “blue”, height: 72, boss: “ben”} {name: “brendan”, aliases: [“el diablo”]} name: “ben”, hat: ”yes”} {name: “matt”, pizza: “DiGiorno”, height: 72, boss: 555.555.1212} {name: “will”, eyes: “blue”, birthplace: “NY”, aliases: [“bill”, “la ciacco”], gender: ”???”, boss: ”ben”}
  • 6. 6 Document Model •  Agility and flexibility – dynamic schema –  Data models can evolve easily –  Companies can adapt to changes quickly •  Intuitive, natural data representation –  Remove impedance mismatch –  Many types of applications are a good fit •  Reduces the need for joins, disk seeks –  Programming is more simple –  Performance can be delivered at scale
  • 11. 11 Shell Command-line shell for interacting directly with database Shell and Drivers Drivers Drivers for most popular programming languages and frameworks > db.collection.insert({company:“10gen”, product:“MongoDB”}) > > db.collection.findOne() { “_id” : ObjectId(“5106c1c2fc629bfe52792e86”), “company” : “10gen” “product” : “MongoDB” } Java Python Perl Ruby Haskell JavaScript
  • 12. 12 •  Ad-hoc queries •  Real-time aggregation •  Rich query capabilities •  Index support - secondary, compound, text, geo and more •  Strong (traditional) consistency •  Geospatial features •  Support for most programming languages •  Flexible schema MongoDB is Full Featured
  • 13. 13 Features In Practice Queries •  Find Paul’s cars •  Find everybody in London with a car built between 1970 and 1980 Geospatial •  Find all of the car owners within 5km of Trafalgar Sq. Text Search •  Find all the cars described as having leather seats Aggregation •  Calculate the average value of Paul’s car collection Map Reduce •  What is the ownership pattern of colors by geography over time? (is purple trending up in China?) { first_name: ‘Paul’,! surname: ‘Miller’,! city: ‘London’,! location: {! !type: “Point”, !coordinates :! ! ![-0.128, 51.507]! !},! cars: [ ! { model: ‘Bentley’,! year: 1973,! value: 100000, … },! { model: ‘Rolls Royce’,! year: 1965,! value: 330000, … }! }! }!
  • 14. 14 Query Example Rich Queries •  Find Paul’s cars •  Find everybody in London with a car built between 1970 and 1980 db.cars.find({ first_name: ‘Paul’! }) db.cars.find({ !city: ‘London’, ”cars.year" : { $gte : 1970, $lte : 1980 } }) ! { first_name: ‘Paul’,! surname: ‘Miller’,! city: ‘London’,! location: {! !type: “Point”, !coordinates :! ! ![-0.128, 51.507]! !},! cars: [ ! { model: ‘Bentley’,! year: 1973,! value: 100000, … },! { model: ‘Rolls Royce’,! year: 1965,! value: 330000, … }! }! }!
  • 15. 15 Geo Spatial Example db.cars.find( { location: { $near : { $geometry : { type: 'Point' , coordinates : [-0.128,51.507] } }, $maxDistance :5000 } } ) ! Geospatial •  Find all of the car owners within 5km of Trafalgar Sq. { first_name: ‘Paul’,! surname: ‘Miller’,! city: ‘London’,! location: {! !type: “Point”, !coordinates :! ! ![-0.128, 51.507]! !},! cars: [ ! { model: ‘Bentley’,! year: 1973,! value: 100000, … },! { model: ‘Rolls Royce’,! year: 1965,! value: 330000, … }! }! }!
  • 16. 16 Aggregation Framework Example db.cars.aggregate( [ {$match : {"first_name" : "Paul"}}, {$project : {"first_name":1,"cars":1}}, {$unwind : "$cars"}, { $group : {_id:"$first_name", average : { $avg : "$cars.value"}}} ]) { "_id" : "Paul", "average" : 215000 } ! Aggregation •  Calculate the average value of Paul’s car collection { first_name: ‘Paul’,! surname: ‘Miller’,! city: ‘London’,! location: {! !type: “Point”, !coordinates :! ! ![-0.128, 51.507]! !},! cars: [ ! { model: ‘Bentley’,! year: 1973,! value: 100000, … },! { model: ‘Rolls Royce’,! year: 1965,! value: 330000, … }! }! }!
  • 18. 18 Automatic Sharding •  Three types of sharding: hash-based, range-based, tag- aware •  Increase or decrease capacity as you go •  Automatic balancing
  • 19. 19 Query Routing •  Multiple query optimization models •  Each sharding option appropriate for different apps
  • 21. 21 Replica Sets •  Replica Set – two or more copies •  “Self-healing” shard •  Addresses many concerns: -  High Availability -  Disaster Recovery -  Maintenance
  • 22. 22 Replica Set Benefits Business Needs Replica Set Benefits High Availability Automated failover Disaster Recovery Hot backups offsite Maintenance Rolling upgrades Low Latency Locate data near users Workload Isolation Read from non-primary replicas Data Privacy Restrict data to physical location Data Consistency Tunable Consistency
  • 25. 25 Disk Seeks and Data Locality Seek = 5+ ms Read = really really fast User Comment Article
  • 26. 26 Disk Seeks and Data Locality Article User CommentCommentCommentCommentComment
  • 28. 28 MongoDB Use Cases Big Data Product & Asset Catalogs Security & Fraud Internet of Things Database-as-a- Service Mobile Apps Customer Data Management Data Hub Social & Collaboration Content Management Intelligence Agencies Top Investment and Retail Banks Top US Retailer Top Global Shipping Company Top Industrial Equipment Manufacturer Top Media Company Top Investment and Retail Banks
  • 29. 29 •  Document Model –  Simplify development –  Simplify scale out –  Improve performance •  MongoDB – leading NoSQL database –  Rich general purpose database –  Fully featured –  Built-in HA (High Availability) and automated failover –  Built-in horizontal scale-out Summary
  • 33. 33 For More Information Resource Location MongoDB Downloads mongodb.com/download Free Online Training education.mongodb.com Webinars and Events mongodb.com/events White Papers mongodb.com/white-papers Case Studies mongodb.com/customers Presentations mongodb.com/presentations Documentation docs.mongodb.org Additional Info info@mongodb.com Resource Location