SlideShare une entreprise Scribd logo
1  sur  30
Application Development Series
Back to Basics – Introduction

Daniel Roberts
@dmroberts
#MongoDBBasics
Introduction
• About the Webinar Series
• Data Model
• Query Model
• Scalability
• Availability

• Deployment Architectures
• Performance
• Next Session
2
Series Outline & Approach
• Split into 2 sections
– Application Development (4 parts)
•
•
•
•

Schema Design
Interacting with the database query and update operators
Indexing
Reporting

– Operations (3 parts)
• Deployment – scale out and high availability
• Monitoring and performance tuning
• Backup and recovery

3
Application Overview
• Content Management System
– Will utilise :
•
•
•
•
•
•

Query & update operators
Aggregation Framework
Geospatial queries
Pre Aggregated reports for fast analytics
Polymorphic documents
And more…

• Take away framework
• An approach that you can reuse in your own
applications
4
Q&A
• Virtual Genius Bar
– Use the chat to post
questions
– EMEA Solution
Architecture team are
on hand
– Make use of them
during the sessions!!!
5
MongoDB
Operational Database

7
Document Data Model
Document - Collections
Relational - Tables

8

{ 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 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
9
Simplify development

10
Simplify development

11
Rich database interaction

12
Query Model
Shell and Drivers
Drivers
Drivers for most popular
programming languages and
frameworks

Java

Ruby

JavaScript

Python

Shell
Command-line shell for
interacting directly with
database

14

Perl

Haskell

> db.collection.insert({company:“10gen”,
product:“MongoDB”})
>
> db.collection.findOne()
{
“_id”
: ObjectId(“5106c1c2fc629bfe52792e86”),
“company”
: “10gen”
“product”
: “MongoDB”
}
MongoDB is full featured
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?)

15

{ 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, … }
}
}
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
}
})

16

{ 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, … }
}
}
Geo Spatial Example
Geospatial

• Find all of the car owners within 5km of
Trafalgar Sq.

db.cars.find( {
location:
{ $near :
{ $geometry :
{
type: 'Point' ,
coordinates :
[-0.128, 51.507]
}
},
$maxDistance :5000
}
})

17

{ 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, … }
}
}
Aggregation Framework Example
Aggregation

• Calculate the average value of Paul’s
car collection

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 }

18

{ 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
Automatic Sharding

• Three types of sharding: hash-based, range-based, tagaware
• Increase or decrease capacity as you go
• Automatic balancing

20
Query Routing

• Multiple query optimization models
• Each sharding option appropriate for different apps
21
Availability
Availability Considerations
• High Availability – Ensure application availability during
many types of failures
• Disaster Recovery – Address the RTO and RPO goals
for business continuity
• Maintenance – Perform upgrades and other maintenance
operations with no application downtime

23
Replica Sets
• Replica Set – two or more copies
• “Self-healing” shard
• Addresses many concerns:
- High Availability
- Disaster Recovery
- Maintenance

24
Replica Set Benefits

Business Needs

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

25

Replica Set Benefits

Tunable Consistency
Performance
Performance

Better Data
Locality
27

In-Memory
Caching

In-Place
Updates
Summary
• Document Model
– Simplify development
– Simplify scale out
– Improve performance

• MongoDB
– Rich general purpose database
– Built in High Availability and Failover
– Built in scale out

28
Next Week – 6th February
• Matt Bates
– Schema design for the CMS application
• Collections
• Design decisions

– Application architecture
• Example technologies
• RESTful interface
• We‟ve chosen python for the examples

– Code Examples
29
Webinar: Getting Started with MongoDB - Back to Basics

Contenu connexe

Tendances

MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive Guide
Wildan Maulana
 

Tendances (20)

Back to Basics Webinar 3: Schema Design Thinking in Documents
 Back to Basics Webinar 3: Schema Design Thinking in Documents Back to Basics Webinar 3: Schema Design Thinking in Documents
Back to Basics Webinar 3: Schema Design Thinking in Documents
 
MongoDB
MongoDBMongoDB
MongoDB
 
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
 
Back to Basics: My First MongoDB Application
Back to Basics: My First MongoDB ApplicationBack to Basics: My First MongoDB Application
Back to Basics: My First MongoDB Application
 
Webinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDBWebinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDB
 
Back to Basics Webinar 1 - Introduction to NoSQL
Back to Basics Webinar 1 - Introduction to NoSQLBack to Basics Webinar 1 - Introduction to NoSQL
Back to Basics Webinar 1 - Introduction to NoSQL
 
Back to Basics Webinar 3: Introduction to Replica Sets
Back to Basics Webinar 3: Introduction to Replica SetsBack to Basics Webinar 3: Introduction to Replica Sets
Back to Basics Webinar 3: Introduction to Replica Sets
 
Webinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in DocumentsWebinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in Documents
 
Back to Basics Webinar 3 - Thinking in Documents
Back to Basics Webinar 3 - Thinking in DocumentsBack to Basics Webinar 3 - Thinking in Documents
Back to Basics Webinar 3 - Thinking in Documents
 
Indexing
IndexingIndexing
Indexing
 
Introduction to MongoDB and Hadoop
Introduction to MongoDB and HadoopIntroduction to MongoDB and Hadoop
Introduction to MongoDB and Hadoop
 
Back to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB ApplicationBack to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB Application
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive Guide
 
Back to Basics 2017: Mí primera aplicación MongoDB
Back to Basics 2017: Mí primera aplicación MongoDBBack to Basics 2017: Mí primera aplicación MongoDB
Back to Basics 2017: Mí primera aplicación MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB and Python
MongoDB and PythonMongoDB and Python
MongoDB and Python
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
MongoDB - Ekino PHP
MongoDB - Ekino PHPMongoDB - Ekino PHP
MongoDB - Ekino PHP
 

En vedette

Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
MongoDB
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB Tutorial
Steven Francia
 

En vedette (10)

Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
 
Back to Basics, webinar 4: Indicizzazione avanzata, indici testuali e geospaz...
Back to Basics, webinar 4: Indicizzazione avanzata, indici testuali e geospaz...Back to Basics, webinar 4: Indicizzazione avanzata, indici testuali e geospaz...
Back to Basics, webinar 4: Indicizzazione avanzata, indici testuali e geospaz...
 
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
MongoDB Schema Design (Event: An Evening with MongoDB Houston 3/11/15)
 
MongoDB for Developers
MongoDB for DevelopersMongoDB for Developers
MongoDB for Developers
 
Back to Basics Webinar 6: Production Deployment
Back to Basics Webinar 6: Production DeploymentBack to Basics Webinar 6: Production Deployment
Back to Basics Webinar 6: Production Deployment
 
Beyond the Basics 1: Storage Engines
Beyond the Basics 1: Storage EnginesBeyond the Basics 1: Storage Engines
Beyond the Basics 1: Storage Engines
 
Mongo db data-models guide
Mongo db data-models guideMongo db data-models guide
Mongo db data-models guide
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB Tutorial
 
Advanced Schema Design Patterns
Advanced Schema Design PatternsAdvanced Schema Design Patterns
Advanced Schema Design Patterns
 
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
 

Similaire à Webinar: Getting Started with MongoDB - Back to Basics

Webinar : Premiers pas avec MongoDB - Back to Basics
Webinar : Premiers pas avec MongoDB - Back to BasicsWebinar : Premiers pas avec MongoDB - Back to Basics
Webinar : Premiers pas avec MongoDB - Back to Basics
MongoDB
 
S01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodbS01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodb
MongoDB
 
Building your First MEAN App
Building your First MEAN AppBuilding your First MEAN App
Building your First MEAN App
MongoDB
 

Similaire à Webinar: Getting Started with MongoDB - Back to Basics (20)

Webinar : Premiers pas avec MongoDB - Back to Basics
Webinar : Premiers pas avec MongoDB - Back to BasicsWebinar : Premiers pas avec MongoDB - Back to Basics
Webinar : Premiers pas avec MongoDB - Back to Basics
 
S01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodbS01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodb
 
Building your First MEAN App
Building your First MEAN AppBuilding your First MEAN App
Building your First MEAN App
 
An Introduction to Mongo DB
An Introduction to Mongo DBAn Introduction to Mongo DB
An Introduction to Mongo DB
 
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
 
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
 
Building your first MEAN application
Building your first MEAN applicationBuilding your first MEAN application
Building your first MEAN application
 
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
 
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 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
 
Simplifying & accelerating application development with MongoDB's intelligent...
Simplifying & accelerating application development with MongoDB's intelligent...Simplifying & accelerating application development with MongoDB's intelligent...
Simplifying & accelerating application development with MongoDB's intelligent...
 
Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101Ops Jumpstart: MongoDB Administration 101
Ops Jumpstart: MongoDB Administration 101
 
MongoDB Workshop Sophia Conf 2018
MongoDB Workshop Sophia Conf 2018MongoDB Workshop Sophia Conf 2018
MongoDB Workshop Sophia Conf 2018
 
MongoDB Meetup
MongoDB MeetupMongoDB Meetup
MongoDB Meetup
 
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
 
MongoDB Evenings Toronto - Monolithic to Microservices with MongoDB
MongoDB Evenings Toronto - Monolithic to Microservices with MongoDBMongoDB Evenings Toronto - Monolithic to Microservices with MongoDB
MongoDB Evenings Toronto - Monolithic to Microservices with MongoDB
 
MongoDB Basics
MongoDB BasicsMongoDB Basics
MongoDB Basics
 
Introduction to new high performance storage engines in mongodb 3.0
Introduction to new high performance storage engines in mongodb 3.0Introduction to new high performance storage engines in mongodb 3.0
Introduction to new high performance storage engines in mongodb 3.0
 
Understanding and tuning WiredTiger, the new high performance database engine...
Understanding and tuning WiredTiger, the new high performance database engine...Understanding and tuning WiredTiger, the new high performance database engine...
Understanding and tuning WiredTiger, the new high performance database engine...
 
Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB
 Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB
Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB
 

Plus de MongoDB

Plus de MongoDB (20)

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
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
 

Dernier (20)

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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Webinar: Getting Started with MongoDB - Back to Basics

  • 1. Application Development Series Back to Basics – Introduction Daniel Roberts @dmroberts #MongoDBBasics
  • 2. Introduction • About the Webinar Series • Data Model • Query Model • Scalability • Availability • Deployment Architectures • Performance • Next Session 2
  • 3. Series Outline & Approach • Split into 2 sections – Application Development (4 parts) • • • • Schema Design Interacting with the database query and update operators Indexing Reporting – Operations (3 parts) • Deployment – scale out and high availability • Monitoring and performance tuning • Backup and recovery 3
  • 4. Application Overview • Content Management System – Will utilise : • • • • • • Query & update operators Aggregation Framework Geospatial queries Pre Aggregated reports for fast analytics Polymorphic documents And more… • Take away framework • An approach that you can reuse in your own applications 4
  • 5. Q&A • Virtual Genius Bar – Use the chat to post questions – EMEA Solution Architecture team are on hand – Make use of them during the sessions!!! 5
  • 8. Document Data Model Document - Collections Relational - Tables 8 { 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, … } } }
  • 9. 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 9
  • 14. Shell and Drivers Drivers Drivers for most popular programming languages and frameworks Java Ruby JavaScript Python Shell Command-line shell for interacting directly with database 14 Perl Haskell > db.collection.insert({company:“10gen”, product:“MongoDB”}) > > db.collection.findOne() { “_id” : ObjectId(“5106c1c2fc629bfe52792e86”), “company” : “10gen” “product” : “MongoDB” }
  • 15. MongoDB is full featured 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?) 15 { 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. 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 } }) 16 { 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, … } } }
  • 17. Geo Spatial Example Geospatial • Find all of the car owners within 5km of Trafalgar Sq. db.cars.find( { location: { $near : { $geometry : { type: 'Point' , coordinates : [-0.128, 51.507] } }, $maxDistance :5000 } }) 17 { 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. Aggregation Framework Example Aggregation • Calculate the average value of Paul’s car collection 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 } 18 { 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, … } } }
  • 20. Automatic Sharding • Three types of sharding: hash-based, range-based, tagaware • Increase or decrease capacity as you go • Automatic balancing 20
  • 21. Query Routing • Multiple query optimization models • Each sharding option appropriate for different apps 21
  • 23. Availability Considerations • High Availability – Ensure application availability during many types of failures • Disaster Recovery – Address the RTO and RPO goals for business continuity • Maintenance – Perform upgrades and other maintenance operations with no application downtime 23
  • 24. Replica Sets • Replica Set – two or more copies • “Self-healing” shard • Addresses many concerns: - High Availability - Disaster Recovery - Maintenance 24
  • 25. Replica Set Benefits Business Needs 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 25 Replica Set Benefits Tunable Consistency
  • 28. Summary • Document Model – Simplify development – Simplify scale out – Improve performance • MongoDB – Rich general purpose database – Built in High Availability and Failover – Built in scale out 28
  • 29. Next Week – 6th February • Matt Bates – Schema design for the CMS application • Collections • Design decisions – Application architecture • Example technologies • RESTful interface • We‟ve chosen python for the examples – Code Examples 29