SlideShare una empresa de Scribd logo
1 de 37
Descargar para leer sin conexión
Technical Evangelist,MongoDB

@tgrall
Tugdual “Tug” Grall
@Neotys
SQLvs NoSQL Performance
A MongoDB perspective
@tgralltug@mongodb.com
{ “about” : “me” }
Tugdual“Tug”Grall
• MongoDB
• Technical Evangelist
• Couchbase
• Technical Evangelist
• eXo
• CTO
• Oracle
• Developer/Product Manager
• Mainly Java/SOA
• Developer in consulting firms
• Web
• @tgrall
• http://blog.grallandco.com
• tgrall
• NantesJUG co-founder
• Pet Project :
• http://www.resultri.com
• tug@mongodb.com
• tugdual@gmail.com
Why MongoDB ?
@tgralltug@mongodb.com
Relational Database
@tgralltug@mongodb.com
@tgralltug@mongodb.com
And makes things hard to change
Name Age Phone Email
New Column
New Table
New Table
New Column
@tgralltug@mongodb.com
It runs on expensive hardware
“Clients can also opt to run zEC12 without a raised
datacenter floor -- a first for high-end IBM mainframes.” !
!
IBM Press Release 28 Aug, 2012!
@tgralltug@mongodb.com
This was a problem for Google
250,000+MBP’s==4.1miles
2010 Search Index Size: !
100,000,000 GB
New data added per day!
100,000+ GB
Databases they could use!
0
@tgralltug@mongodb.com
And for Facebook
What is MongoDB?
@tgralltug@mongodb.com
MongoDB Vision
To provide the best database for how we build and run
apps today
Build
• New and complex data
• Flexible
• New languages
• Faster development
Run
• Big Data scalability
• Real-time
• Commodity hardware
• Cloud
@tgralltug@mongodb.com
Documents are easier
Relational MongoDB
{	
  
	
  	
  first_name:	
  "Paul",
	
  	
  surname:	
  "Miller",
	
  	
  city:	
  "London",
	
  	
  location:	
  [45.123,47.232],
	
  	
  cars:	
  [	
  
	
  	
  	
  	
  {	
  model:	
  "Bentley",
	
  	
  	
  	
  	
  	
  year:	
  1973,
	
  	
  	
  	
  	
  	
  value:	
  100000,	
  …	
  },
	
  	
  	
  	
  {	
  model:	
  "Rolls	
  Royce",	
  
	
  	
  	
  	
  	
  	
  year:	
  1965,	
  
	
  	
  	
  	
  	
  	
  value:	
  330000,	
  …	
  }	
  
	
  	
  ]
}
@tgralltug@mongodb.com
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?)
{ 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, … }
}
}
@tgralltug@mongodb.com
Easier and Cheaper to Scale
Vs.
Price
Scale
Price
Scale
@tgralltug@mongodb.com
7,000,000+
MongoDB Downloads
150,000+
Online Education Registrants
25,000+
MongoDB User Group Members
25,000+
MongoDB Management Service (MMS) Users
20,000+
MongoDB Days Attendees
@tgralltug@mongodb.com
MongoDB Use Cases
16
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
MongoDB Deployments
@tgralltug@mongodb.com
High Availability : Replication
@tgralltug@mongodb.com
Horizontal Scalability: Sharding
Shard 1 Shard 1 Shard nShard 1 …
Horizontally Scalable
@tgralltug@mongodb.com
MongoDB Architecture
@tgralltug@mongodb.com
Multi Data Center
Performance
MongoDB is a Distributed Database
Insert Update Delete Query Aggregations
@tgralltug@mongodb.com
Queries
@tgralltug@mongodb.com
Analyze Query Performance
• Use query explain() cursor method
• Use Database Profiler to find slow queries
db.inventory.find( { type: 'food' } ).explain()!
!
{!
"cursor" : "BtreeCursor type_1",!
"isMultiKey" : false,!
"n" : 5,!
"nscannedObjects" : 5,!
"nscanned" : 5,!
"nscannedObjectsAllPlans" : 5,!
"nscannedAllPlans" : 5,!
…!
"scanAndOrder" : false,!
"millis" : 0,!
"indexBounds" : { "type" : [!
[ "food",!
"food" ]!
] },!
"server" : "mongodbo0.example.net:27017" }
@tgralltug@mongodb.com
Monitoring the system
@tgralltug@mongodb.com
Monitor: What to look?
Locks Avoid long running operations that could slow down the database
Page Faults Check that the working set stays in RAM, reduce I/O operations
Nbr of Connections Reduce RAM consumption
Replication Lag Time to copy the data to secondaries
OpLog Size Size of the replication queue
Chunk Distribution Data should be balanced on all the nodes
@tgralltug@mongodb.com
Many tools / Many Metrics
• MMS : MongoDB Management Services
• CLI and RESTAPI
• Neotys
More..
You must prepare your deployment
@tgralltug@mongodb.com
The most important part
@tgralltug@mongodb.com
Node 1
Secondary
Config
Server
Node 1
Secondary
Config
Server
Node 1
Secondary
Config
Server
Shard Shard Shard
Mongos
App Server
Mongos
App Server
Mongos
App Server
A good shard key
@tgralltug@mongodb.com
Example : email storage
Cardinality!
Write
Scaling!
Query
Isolation!
Reliability!
Index!
Locality!
_id! Doc level! One shard!
Scatter/
gather!
All users
affected!
Good!
hash(_id)! Hash level! All Shards!
Scatter/
gather!
All users
affected!
Poor!
user! Many docs! All Shards! Targeted
Some users
affected
Good!
user, time! Doc level! All Shards! Targeted!
Some users
affected
Good!
Conclusion
@tgralltug@mongodb.com
Conclusion
• MongoDB is a general purpose database
• Document Design
• Create Index and check the explain plans
• MongoDB is a distributed database
• Choose the shard key wisely
• MongoDB use replication
• Check OpLog and Replication Lag
• Monitor all these with tools
Questions?
@tgrall
@neotys
ThankYou

Más contenido relacionado

Similar a Neotys conference

MongoDB and Ruby on Rails
MongoDB and Ruby on RailsMongoDB and Ruby on Rails
MongoDB and Ruby on Rails
rfischer20
 
S01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodbS01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodb
MongoDB
 

Similar a Neotys conference (20)

Old code doesn't stink - Detroit
Old code doesn't stink - DetroitOld code doesn't stink - Detroit
Old code doesn't stink - Detroit
 
MongoDB Basics
MongoDB BasicsMongoDB Basics
MongoDB Basics
 
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
 
MongoDB, E-commerce and Transactions
MongoDB, E-commerce and TransactionsMongoDB, E-commerce and Transactions
MongoDB, E-commerce and Transactions
 
Old code doesn't stink
Old code doesn't stinkOld code doesn't stink
Old code doesn't stink
 
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
 
The Aggregation Framework
The Aggregation FrameworkThe Aggregation Framework
The Aggregation Framework
 
MongoDB
MongoDBMongoDB
MongoDB
 
Tugdual Grall - From SQL to NoSQL in less than 40 min - NoSQL matters Paris 2015
Tugdual Grall - From SQL to NoSQL in less than 40 min - NoSQL matters Paris 2015Tugdual Grall - From SQL to NoSQL in less than 40 min - NoSQL matters Paris 2015
Tugdual Grall - From SQL to NoSQL in less than 40 min - NoSQL matters Paris 2015
 
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep DiveMongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive
MongoDB .local Toronto 2019: MongoDB Atlas Search Deep Dive
 
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
 
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!
 
MongoDB at ZPUGDC
MongoDB at ZPUGDCMongoDB at ZPUGDC
MongoDB at ZPUGDC
 
Webinar: Getting Started with MongoDB - Back to Basics
Webinar: Getting Started with MongoDB - Back to BasicsWebinar: Getting Started with MongoDB - Back to Basics
Webinar: Getting Started with MongoDB - Back to Basics
 
MongoDB and Ruby on Rails
MongoDB and Ruby on RailsMongoDB and Ruby on Rails
MongoDB and Ruby on Rails
 
Autogenerate Awesome GraphQL Documentation with SpectaQL
Autogenerate Awesome GraphQL Documentation with SpectaQLAutogenerate Awesome GraphQL Documentation with SpectaQL
Autogenerate Awesome GraphQL Documentation with SpectaQL
 
S01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodbS01 e00 einfuehrung-in_mongodb
S01 e00 einfuehrung-in_mongodb
 
MongoDB.local Dallas 2019: Building Your First MongoDB App Using Atlas & Stitch
MongoDB.local Dallas 2019: Building Your First MongoDB App Using Atlas & StitchMongoDB.local Dallas 2019: Building Your First MongoDB App Using Atlas & Stitch
MongoDB.local Dallas 2019: Building Your First MongoDB App Using Atlas & Stitch
 
Time Series Databases for IoT (On-premises and Azure)
Time Series Databases for IoT (On-premises and Azure)Time Series Databases for IoT (On-premises and Azure)
Time Series Databases for IoT (On-premises and Azure)
 
Webinar: When to Use MongoDB
Webinar: When to Use MongoDBWebinar: When to Use MongoDB
Webinar: When to Use MongoDB
 

Más de Tugdual Grall

Opensourceday 2014-iot
Opensourceday 2014-iotOpensourceday 2014-iot
Opensourceday 2014-iot
Tugdual Grall
 

Más de Tugdual Grall (20)

Introduction to Streaming with Apache Flink
Introduction to Streaming with Apache FlinkIntroduction to Streaming with Apache Flink
Introduction to Streaming with Apache Flink
 
Introduction to Streaming with Apache Flink
Introduction to Streaming with Apache FlinkIntroduction to Streaming with Apache Flink
Introduction to Streaming with Apache Flink
 
Fast Cars, Big Data - How Streaming Can Help Formula 1
Fast Cars, Big Data - How Streaming Can Help Formula 1Fast Cars, Big Data - How Streaming Can Help Formula 1
Fast Cars, Big Data - How Streaming Can Help Formula 1
 
Lambda Architecture: The Best Way to Build Scalable and Reliable Applications!
Lambda Architecture: The Best Way to Build Scalable and Reliable Applications!Lambda Architecture: The Best Way to Build Scalable and Reliable Applications!
Lambda Architecture: The Best Way to Build Scalable and Reliable Applications!
 
Big Data Journey
Big Data JourneyBig Data Journey
Big Data Journey
 
Proud to be Polyglot - Riviera Dev 2015
Proud to be Polyglot - Riviera Dev 2015Proud to be Polyglot - Riviera Dev 2015
Proud to be Polyglot - Riviera Dev 2015
 
Introduction to NoSQL with MongoDB - SQLi Workshop
Introduction to NoSQL with MongoDB - SQLi WorkshopIntroduction to NoSQL with MongoDB - SQLi Workshop
Introduction to NoSQL with MongoDB - SQLi Workshop
 
Enabling Telco to Build and Run Modern Applications
Enabling Telco to Build and Run Modern Applications Enabling Telco to Build and Run Modern Applications
Enabling Telco to Build and Run Modern Applications
 
MongoDB and Hadoop
MongoDB and HadoopMongoDB and Hadoop
MongoDB and Hadoop
 
Proud to be polyglot
Proud to be polyglotProud to be polyglot
Proud to be polyglot
 
Drop your table ! MongoDB Schema Design
Drop your table ! MongoDB Schema DesignDrop your table ! MongoDB Schema Design
Drop your table ! MongoDB Schema Design
 
Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6
Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6
Devoxx 2014 : Atelier MongoDB - Decouverte de MongoDB 2.6
 
Some cool features of MongoDB
Some cool features of MongoDBSome cool features of MongoDB
Some cool features of MongoDB
 
Opensourceday 2014-iot
Opensourceday 2014-iotOpensourceday 2014-iot
Opensourceday 2014-iot
 
Softshake 2013: Introduction to NoSQL with Couchbase
Softshake 2013: Introduction to NoSQL with CouchbaseSoftshake 2013: Introduction to NoSQL with Couchbase
Softshake 2013: Introduction to NoSQL with Couchbase
 
Introduction to NoSQL with Couchbase
Introduction to NoSQL with CouchbaseIntroduction to NoSQL with Couchbase
Introduction to NoSQL with Couchbase
 
Why and How to integrate Hadoop and NoSQL?
Why and How to integrate Hadoop and NoSQL?Why and How to integrate Hadoop and NoSQL?
Why and How to integrate Hadoop and NoSQL?
 
NoSQL Matters 2013 - Introduction to Map Reduce with Couchbase 2.0
NoSQL Matters 2013 - Introduction to Map Reduce with Couchbase 2.0NoSQL Matters 2013 - Introduction to Map Reduce with Couchbase 2.0
NoSQL Matters 2013 - Introduction to Map Reduce with Couchbase 2.0
 
Big Data Paris : Hadoop and NoSQL
Big Data Paris : Hadoop and NoSQLBig Data Paris : Hadoop and NoSQL
Big Data Paris : Hadoop and NoSQL
 
Big Data Israel Meetup : Couchbase and Big Data
Big Data Israel Meetup : Couchbase and Big DataBig Data Israel Meetup : Couchbase and Big Data
Big Data Israel Meetup : Couchbase and Big Data
 

Último

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
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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, ...
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"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 ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
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 ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
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
 

Neotys conference