SlideShare a Scribd company logo
1 of 21
MongoDB In Action 超群.com @fuchaoqun http://www.fuchaoqun.com
I will talk …. ,[object Object]
Dynamic querys
Replication
Sharding
GridFS
Performance,[object Object]
About MongoDB? ,[object Object]
JSON-style documents
Schema-free
Written in C++ for high  performance
Scalable
MapReduce
Many supported platforms & languages,[object Object]
Dynamic querysInsert MySQL: INSERT INOT user (`name`, `age`) values ('foobar',25) Mongo:     db.user.insert({'name' : 'foobar', 'age' : 25}) if you want add a  column `email` on MySQL,you must : ALTER TABLE user…. But in Mongo,you can just:     db.user.insert({'name' : 'foobar', 'age' : 25, 'email' : 'foo@bar.com'})
Dynamic querysDelete MySQL: DELETE * FROM user Mongo:     db.user.remove({}) MySQL: DELETE FROM user WHERE age < 30 Mongo:     db.user.remove({'age' : {$lt : 30}}) $gt : > ; $gte : >= ; $lt : < ; $lte : <= ; $ne : !=
Dynamic querysUpdate MySQL: UPDATE user SET `age` = 36 WHERE `name` = 'foobar' Mongo:     db.user.update({'name' : 'foobar'}, {$set : {'age' : 36}}) MySQL:     UPDATE user SET `age` = `age` + 3 WHERE `name` = 'foobar' Mongo:     db.user.update({'name' : 'foobar'}, {$inc : {'age' : 3}}) See more @ http://tinyurl.com/yka6ras
Dynamic querysAdvanced MySQL: SELECT COUNT(*) FROM user WHERE `name` = 'foobar' Mongo:     db.user.find({'name' : 'foobar'}).count() MySQL:     SELECT * FROM user limit 10,20 Mongo:     db.user.find().skip(10).limit(20)
Dynamic querysAdvanced MySQL: SELECT * FROM user WHERE `age` IN (25, 35,45) Mongo:     db.user.find({'age' : {$in : [25, 35, 45]}}) MySQL:     SELECT * FROM user limit 10,20 Mongo:     db.user.find().skip(10).limit(20)
Dynamic querysAdvanced MySQL: SELECT * FROM user ORDER BY age DESC Mongo:     db.user.find().sort({'age' : -1}) MySQL:     SELECT DISTINCT(name) FROM user WHERE age > 20 Mongo:     db.user.distinct('name', {'age': {$lt : 20}})
Dynamic querysAdvanced MySQL: SELECT name, sum(marks) FROM user GROUP BY name Mongo:     db.user.group({         key : {'name' : true}, cond: {'name' : 'foo'},         reduce: function(obj,prev) { prev.msum += obj.marks; },         initial: {msum : 0}     }); MySQL:     SELECT name FROM user WHERE age < 20 Mongo:     db.user.find('this.age < 20', {name : 1}) See more @ http://tinyurl.com/ykyuuwo

More Related Content

What's hot

What's hot (10)

MySQL vs. PostgreSQL
MySQL vs. PostgreSQLMySQL vs. PostgreSQL
MySQL vs. PostgreSQL
 
NoSQL with MongoDB
NoSQL with MongoDBNoSQL with MongoDB
NoSQL with MongoDB
 
NoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDBNoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDB
 
Apache CouchDB Presentation @ Sept. 2104 GTALUG Meeting
Apache CouchDB Presentation @ Sept. 2104 GTALUG MeetingApache CouchDB Presentation @ Sept. 2104 GTALUG Meeting
Apache CouchDB Presentation @ Sept. 2104 GTALUG Meeting
 
AST + Better Reflection (PHP Benelux 2016 Unconference)
AST + Better Reflection (PHP Benelux 2016 Unconference)AST + Better Reflection (PHP Benelux 2016 Unconference)
AST + Better Reflection (PHP Benelux 2016 Unconference)
 
Mongodb
MongodbMongodb
Mongodb
 
Android Guava
Android GuavaAndroid Guava
Android Guava
 
2011 09-pdfjs
2011 09-pdfjs2011 09-pdfjs
2011 09-pdfjs
 
Mongodb
MongodbMongodb
Mongodb
 
Kill the DBA
Kill the DBAKill the DBA
Kill the DBA
 

Viewers also liked

Bp to go home 1
Bp to go home 1Bp to go home 1
Bp to go home 1
anabela
 
Chile Forecast
Chile ForecastChile Forecast
Chile Forecast
hsplastic
 
Evan's Exhibition-How to throw a boomerang
Evan's Exhibition-How to throw a boomerangEvan's Exhibition-How to throw a boomerang
Evan's Exhibition-How to throw a boomerang
jtiggs
 
Work Order Summary From Mp2 Database2003
Work Order Summary From Mp2 Database2003Work Order Summary From Mp2 Database2003
Work Order Summary From Mp2 Database2003
Mbisset
 
El objeto de consumo, maureira ramirez
El objeto de consumo, maureira ramirezEl objeto de consumo, maureira ramirez
El objeto de consumo, maureira ramirez
karla777
 
Timyang新浪微博设计谈
Timyang新浪微博设计谈Timyang新浪微博设计谈
Timyang新浪微博设计谈
Cevin Cheung
 
Disección de un corazón
Disección de un corazónDisección de un corazón
Disección de un corazón
tmi4eso
 
Programas Gambas
Programas GambasProgramas Gambas
Programas Gambas
RZYMJ
 
Erasmuslaan 10 Zeist (www.boonmakelaars.nl)
Erasmuslaan 10 Zeist (www.boonmakelaars.nl)Erasmuslaan 10 Zeist (www.boonmakelaars.nl)
Erasmuslaan 10 Zeist (www.boonmakelaars.nl)
DIRK Makelaars Taxateurs BV
 

Viewers also liked (20)

Bp to go home 1
Bp to go home 1Bp to go home 1
Bp to go home 1
 
Chile Forecast
Chile ForecastChile Forecast
Chile Forecast
 
Pneumonia Hospitalar
Pneumonia HospitalarPneumonia Hospitalar
Pneumonia Hospitalar
 
Evan's Exhibition-How to throw a boomerang
Evan's Exhibition-How to throw a boomerangEvan's Exhibition-How to throw a boomerang
Evan's Exhibition-How to throw a boomerang
 
Sofia
SofiaSofia
Sofia
 
CV
CVCV
CV
 
Selected banks performance analysis
Selected banks performance analysisSelected banks performance analysis
Selected banks performance analysis
 
Work Order Summary From Mp2 Database2003
Work Order Summary From Mp2 Database2003Work Order Summary From Mp2 Database2003
Work Order Summary From Mp2 Database2003
 
Social Unit
Social UnitSocial Unit
Social Unit
 
El objeto de consumo, maureira ramirez
El objeto de consumo, maureira ramirezEl objeto de consumo, maureira ramirez
El objeto de consumo, maureira ramirez
 
Timyang新浪微博设计谈
Timyang新浪微博设计谈Timyang新浪微博设计谈
Timyang新浪微博设计谈
 
Community Management Blaupause
Community Management BlaupauseCommunity Management Blaupause
Community Management Blaupause
 
"Ouçamos a voz de Deus, não dos falsos profetas"
"Ouçamos a voz de Deus, não dos falsos profetas""Ouçamos a voz de Deus, não dos falsos profetas"
"Ouçamos a voz de Deus, não dos falsos profetas"
 
Disección de un corazón
Disección de un corazónDisección de un corazón
Disección de un corazón
 
A protest in respect to my sir
A protest in respect to my sirA protest in respect to my sir
A protest in respect to my sir
 
Berufliches Schulungszentrum Freital
Berufliches Schulungszentrum FreitalBerufliches Schulungszentrum Freital
Berufliches Schulungszentrum Freital
 
Last evolution of french practices by Bruno Florence
Last evolution of french practices by Bruno FlorenceLast evolution of french practices by Bruno Florence
Last evolution of french practices by Bruno Florence
 
Programas Gambas
Programas GambasProgramas Gambas
Programas Gambas
 
Markensymposium 2009 - Sophie Karmasin
Markensymposium 2009 - Sophie KarmasinMarkensymposium 2009 - Sophie Karmasin
Markensymposium 2009 - Sophie Karmasin
 
Erasmuslaan 10 Zeist (www.boonmakelaars.nl)
Erasmuslaan 10 Zeist (www.boonmakelaars.nl)Erasmuslaan 10 Zeist (www.boonmakelaars.nl)
Erasmuslaan 10 Zeist (www.boonmakelaars.nl)
 

Similar to Mongodbinaction 100122230824-phpapp01

introtomongodb
introtomongodbintrotomongodb
introtomongodb
saikiran
 
A practical intro to web development with mongo db and nodejs when, why and ...
A practical intro to web development with mongo db and nodejs  when, why and ...A practical intro to web development with mongo db and nodejs  when, why and ...
A practical intro to web development with mongo db and nodejs when, why and ...
jgarifuna
 
A practical intro to web development with mongo db and nodejs when, why and how
A practical intro to web development with mongo db and nodejs  when, why and howA practical intro to web development with mongo db and nodejs  when, why and how
A practical intro to web development with mongo db and nodejs when, why and how
jgarifuna
 

Similar to Mongodbinaction 100122230824-phpapp01 (20)

MongoDB a document store that won't let you down.
MongoDB a document store that won't let you down.MongoDB a document store that won't let you down.
MongoDB a document store that won't let you down.
 
MongoDB
MongoDBMongoDB
MongoDB
 
This upload requires better support for ODP format
This upload requires better support for ODP formatThis upload requires better support for ODP format
This upload requires better support for ODP format
 
A Brief MongoDB Intro
A Brief MongoDB IntroA Brief MongoDB Intro
A Brief MongoDB Intro
 
Mongo-Drupal
Mongo-DrupalMongo-Drupal
Mongo-Drupal
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
introtomongodb
introtomongodbintrotomongodb
introtomongodb
 
Mongo db basic installation
Mongo db basic installationMongo db basic installation
Mongo db basic installation
 
A practical intro to web development with mongo db and nodejs when, why and ...
A practical intro to web development with mongo db and nodejs  when, why and ...A practical intro to web development with mongo db and nodejs  when, why and ...
A practical intro to web development with mongo db and nodejs when, why and ...
 
MongoDB With Style
MongoDB With StyleMongoDB With Style
MongoDB With Style
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
A practical intro to web development with mongo db and nodejs when, why and how
A practical intro to web development with mongo db and nodejs  when, why and howA practical intro to web development with mongo db and nodejs  when, why and how
A practical intro to web development with mongo db and nodejs when, why and how
 
Back to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDBBack to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDB
 
MongoDB Knowledge share
MongoDB Knowledge shareMongoDB Knowledge share
MongoDB Knowledge share
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know
 
Mongo+java (1)
Mongo+java (1)Mongo+java (1)
Mongo+java (1)
 
MongoDB user group israel May
MongoDB user group israel MayMongoDB user group israel May
MongoDB user group israel May
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
 
Sah
SahSah
Sah
 
Front-End Dev Tools
Front-End Dev ToolsFront-End Dev Tools
Front-End Dev Tools
 

More from Cevin Cheung

Mvc架构在discuz!插件开发的应用 wps create_msoffice_check
Mvc架构在discuz!插件开发的应用 wps create_msoffice_checkMvc架构在discuz!插件开发的应用 wps create_msoffice_check
Mvc架构在discuz!插件开发的应用 wps create_msoffice_check
Cevin Cheung
 
淘宝图片存储与Cdn系统
淘宝图片存储与Cdn系统淘宝图片存储与Cdn系统
淘宝图片存储与Cdn系统
Cevin Cheung
 
淘宝网架构:解密淘宝网的开源架构
淘宝网架构:解密淘宝网的开源架构淘宝网架构:解密淘宝网的开源架构
淘宝网架构:解密淘宝网的开源架构
Cevin Cheung
 
海量日志分析系统实践,Dba
海量日志分析系统实践,Dba海量日志分析系统实践,Dba
海量日志分析系统实践,Dba
Cevin Cheung
 
My Sql优化(2009 08 28 系统架构师大会)
My Sql优化(2009 08 28 系统架构师大会)My Sql优化(2009 08 28 系统架构师大会)
My Sql优化(2009 08 28 系统架构师大会)
Cevin Cheung
 

More from Cevin Cheung (6)

Mvc架构在discuz!插件开发的应用 wps create_msoffice_check
Mvc架构在discuz!插件开发的应用 wps create_msoffice_checkMvc架构在discuz!插件开发的应用 wps create_msoffice_check
Mvc架构在discuz!插件开发的应用 wps create_msoffice_check
 
淘宝图片存储与Cdn系统
淘宝图片存储与Cdn系统淘宝图片存储与Cdn系统
淘宝图片存储与Cdn系统
 
淘宝网架构:解密淘宝网的开源架构
淘宝网架构:解密淘宝网的开源架构淘宝网架构:解密淘宝网的开源架构
淘宝网架构:解密淘宝网的开源架构
 
Web缓存加速
Web缓存加速Web缓存加速
Web缓存加速
 
海量日志分析系统实践,Dba
海量日志分析系统实践,Dba海量日志分析系统实践,Dba
海量日志分析系统实践,Dba
 
My Sql优化(2009 08 28 系统架构师大会)
My Sql优化(2009 08 28 系统架构师大会)My Sql优化(2009 08 28 系统架构师大会)
My Sql优化(2009 08 28 系统架构师大会)
 

Recently uploaded

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
 
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
 

Recently uploaded (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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​
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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...
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
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
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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, ...
 

Mongodbinaction 100122230824-phpapp01

  • 1. MongoDB In Action 超群.com @fuchaoqun http://www.fuchaoqun.com
  • 2.
  • 7.
  • 8.
  • 11. Written in C++ for high performance
  • 14.
  • 15. Dynamic querysInsert MySQL: INSERT INOT user (`name`, `age`) values ('foobar',25) Mongo: db.user.insert({'name' : 'foobar', 'age' : 25}) if you want add a column `email` on MySQL,you must : ALTER TABLE user…. But in Mongo,you can just: db.user.insert({'name' : 'foobar', 'age' : 25, 'email' : 'foo@bar.com'})
  • 16. Dynamic querysDelete MySQL: DELETE * FROM user Mongo: db.user.remove({}) MySQL: DELETE FROM user WHERE age < 30 Mongo: db.user.remove({'age' : {$lt : 30}}) $gt : > ; $gte : >= ; $lt : < ; $lte : <= ; $ne : !=
  • 17. Dynamic querysUpdate MySQL: UPDATE user SET `age` = 36 WHERE `name` = 'foobar' Mongo: db.user.update({'name' : 'foobar'}, {$set : {'age' : 36}}) MySQL: UPDATE user SET `age` = `age` + 3 WHERE `name` = 'foobar' Mongo: db.user.update({'name' : 'foobar'}, {$inc : {'age' : 3}}) See more @ http://tinyurl.com/yka6ras
  • 18. Dynamic querysAdvanced MySQL: SELECT COUNT(*) FROM user WHERE `name` = 'foobar' Mongo: db.user.find({'name' : 'foobar'}).count() MySQL: SELECT * FROM user limit 10,20 Mongo: db.user.find().skip(10).limit(20)
  • 19. Dynamic querysAdvanced MySQL: SELECT * FROM user WHERE `age` IN (25, 35,45) Mongo: db.user.find({'age' : {$in : [25, 35, 45]}}) MySQL: SELECT * FROM user limit 10,20 Mongo: db.user.find().skip(10).limit(20)
  • 20. Dynamic querysAdvanced MySQL: SELECT * FROM user ORDER BY age DESC Mongo: db.user.find().sort({'age' : -1}) MySQL: SELECT DISTINCT(name) FROM user WHERE age > 20 Mongo: db.user.distinct('name', {'age': {$lt : 20}})
  • 21. Dynamic querysAdvanced MySQL: SELECT name, sum(marks) FROM user GROUP BY name Mongo: db.user.group({ key : {'name' : true}, cond: {'name' : 'foo'}, reduce: function(obj,prev) { prev.msum += obj.marks; }, initial: {msum : 0} }); MySQL: SELECT name FROM user WHERE age < 20 Mongo: db.user.find('this.age < 20', {name : 1}) See more @ http://tinyurl.com/ykyuuwo
  • 22. So…. MongoDB can do almost everything that MySQL can do, and quicker & smarter
  • 23.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30. Who is using MongoDB? See more @ http://tinyurl.com/dhrryw