SlideShare a Scribd company logo
An introduction to
But First, A Little About MeMy name’s Lee Theobald. Hello!Twitter: @LeesyNever updated blog: http://www.ltheobald.co.uk/I’m a developer at a small search company in Cambridge called Open Objects.
So what is MongoDB?
NoSQL databaseThe name is short for humongousOpen source with development lead by 10Gen (http://www.10gen.com)Document BasedSchema-lessHighly ScalableMapReduceReplication & Auto Sharding
Document StoreData is stored in the form of JSON data.{"_id" : ObjectId("4ccbfc75bd163019417c27f8"),"title": “Hello World! ","author": {"firstname": "Joe","lastname": "Bloggs"    },"tags": ["test", "foo", "bar"]}
Familiar StructureMongoDB instances contain a number of databases which in turn contain a number of collections.Think of MySQL with it’s databases & tables.But collections can also be nested.  E.g.customer_a(Database)logs_201009		(Collection)top_queries(Collection)
Inserts – Easy As Pie!use cookbook;db.desserts.save({   name: "Cherry Pie",   ingredients: ["cherries", "pie"],cooking_time: 30});
Searching – A Piece Of Cakedb.recipes.find({cooking_time: { “$gte”: 10, “$lt”: 30}})db.recipes.findOne()
Some More Advanced Query SyntaxLimitingdb.find().limit(10);Skippingdb.find(	).skip(5);Sortingdb.find({…}).sort({cooking_time: “-1”});Cursorsvar cur = db.find({…}).cursor()cur.forEach( function(x) { print(tojson(x)) });
MapReduceGreat way of doing bulk manipulation or aggregation.2 or 3 functions written in JavaScriptthat execute on the server.An example use could be generating a list of top queries from some search logs.
Map FunctionTakes some input of the form of key/value pairs.Does something with thatReturns 0 or more key/value pairsmap = function() {   if (!this.query) {       return;   }   emit (this.query, {count: 1});}
Reduce FunctionTakes the results from the map functionDoes something (normally combine the results)Produces output in key/value pairsreduce = function(key, values) {var count = 0;values.forEach(function(v) {       count += v[‘count’];    }   return {count: count;}}
Replica SetsMaster/Slave configurationIf your primary server goes down, one of the secondary ones takes over.
Auto Sharding
But Why Not Try It YourselfDownload it at: http://www.mongodb.orgOnline tutorial at:http://www.mongodb.org/display/DOCS/TutorialSome handy MongoDB sites:MongoDB Cookbook: http://cookbook.mongodb.org/Kyle Banker’s blog: http://kylebanker.com/blog/
Thanks For Listening.Any (easy)Questions?

More Related Content

ODP
CouchApp - Build scalable web applications and relax
ODP
node.js - Fast event based web application development
PPTX
Node.js Lightning Talk
PDF
Rust vs. Go: qual è il linguaggio più adatto al tuo progetto?
PPT
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
PPTX
From Web Developer to Hardware Developer
PDF
Selenium sandwich-3: Being where you aren't.
PDF
Web Scrapping with Python
CouchApp - Build scalable web applications and relax
node.js - Fast event based web application development
Node.js Lightning Talk
Rust vs. Go: qual è il linguaggio più adatto al tuo progetto?
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
From Web Developer to Hardware Developer
Selenium sandwich-3: Being where you aren't.
Web Scrapping with Python

What's hot (20)

PDF
Scrapy workshop
PDF
Video WebChat Conference Tool
PDF
ActionHeroJS Talk
PPTX
Mule esb db_1
PPTX
DJUGL - Django and AWS Lambda
PPT
Django and Mongoengine
PDF
Swift Meetup HH 2016/09
PPTX
Mule esb db_2
PPT
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
PDF
Django Mongodb Engine
PDF
Scrapy talk at DataPhilly
PDF
Python, web scraping and content management: Scrapy and Django
PDF
Flex With Rubyamf
PPTX
CouchDB Day NYC 2017: Full Text Search
PDF
Ruby Isn't Just About Rails
PDF
Web Scraping in Python with Scrapy
PDF
Pydata-Python tools for webscraping
PDF
Using ArcGIS Server with Ruby on Rails
PDF
Jan Čurn: Meteor: the full-stack JavaScript framework
PPTX
CouchDB Day NYC 2017: Introduction to CouchDB 2.0
Scrapy workshop
Video WebChat Conference Tool
ActionHeroJS Talk
Mule esb db_1
DJUGL - Django and AWS Lambda
Django and Mongoengine
Swift Meetup HH 2016/09
Mule esb db_2
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
Django Mongodb Engine
Scrapy talk at DataPhilly
Python, web scraping and content management: Scrapy and Django
Flex With Rubyamf
CouchDB Day NYC 2017: Full Text Search
Ruby Isn't Just About Rails
Web Scraping in Python with Scrapy
Pydata-Python tools for webscraping
Using ArcGIS Server with Ruby on Rails
Jan Čurn: Meteor: the full-stack JavaScript framework
CouchDB Day NYC 2017: Introduction to CouchDB 2.0
Ad

Viewers also liked (16)

PPTX
Introduction tomongodb
PPTX
An Introduction To NoSQL & MongoDB
PDF
MongoDB Administration 101
PDF
MongoDB Europe 2016 - Graph Operations with MongoDB
PPTX
基于Python构建可扩展的自动化运维平台
PPTX
Maximizing MongoDB Performance on AWS
PPTX
How Thermo Fisher Is Reducing Mass Spectrometry Experiment Times from Days to...
PDF
MongoDB Europe 2016 - Welcome
PDF
Big Data Spain 2016: Keynote
PDF
MongoDB World 2016: Poster Sessions eBook
PPTX
How Auto Trader enables the UK's largest digital automotive marketplace
PPTX
Webinar: Transitioning from SQL to MongoDB
PDF
Creating a Modern Data Architecture for Digital Transformation
PPTX
Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...
PDF
Webinar: 10-Step Guide to Creating a Single View of your Business
PDF
SlideShare 101
Introduction tomongodb
An Introduction To NoSQL & MongoDB
MongoDB Administration 101
MongoDB Europe 2016 - Graph Operations with MongoDB
基于Python构建可扩展的自动化运维平台
Maximizing MongoDB Performance on AWS
How Thermo Fisher Is Reducing Mass Spectrometry Experiment Times from Days to...
MongoDB Europe 2016 - Welcome
Big Data Spain 2016: Keynote
MongoDB World 2016: Poster Sessions eBook
How Auto Trader enables the UK's largest digital automotive marketplace
Webinar: Transitioning from SQL to MongoDB
Creating a Modern Data Architecture for Digital Transformation
Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...
Webinar: 10-Step Guide to Creating a Single View of your Business
SlideShare 101
Ad

Similar to Introduction To MongoDB (20)

PPT
Developing node-mdb: a Node.js - based clone of SimpleDB
PDF
Into The Box | Alexa and ColdBox Api's
PPT
Architecture | Busy Java Developers Guide to NoSQL | Ted Neward
PDF
SproutCore and the Future of Web Apps
PPTX
hacking with node.JS
PDF
Complex Made Simple: Sleep Better with TorqueBox
PDF
Umleitung: a tiny mochiweb/CouchDB app
PDF
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
PDF
HTML5 for the Silverlight Guy
PDF
CouchDB Mobile - From Couch to 5K in 1 Hour
PPT
Grails Introduction - IJTC 2007
ODP
Introducing CouchDB
ZIP
Javascript Everywhere
PDF
Perkenalan ReasonML
PDF
Cross Domain Web
Mashups with JQuery and Google App Engine
PDF
Introduction to ReasonML
PDF
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
PPTX
MongoDB + Java - Everything you need to know
PPTX
Mongo+java (1)
PPTX
working with PHP & DB's
Developing node-mdb: a Node.js - based clone of SimpleDB
Into The Box | Alexa and ColdBox Api's
Architecture | Busy Java Developers Guide to NoSQL | Ted Neward
SproutCore and the Future of Web Apps
hacking with node.JS
Complex Made Simple: Sleep Better with TorqueBox
Umleitung: a tiny mochiweb/CouchDB app
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
HTML5 for the Silverlight Guy
CouchDB Mobile - From Couch to 5K in 1 Hour
Grails Introduction - IJTC 2007
Introducing CouchDB
Javascript Everywhere
Perkenalan ReasonML
Cross Domain Web
Mashups with JQuery and Google App Engine
Introduction to ReasonML
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
MongoDB + Java - Everything you need to know
Mongo+java (1)
working with PHP & DB's

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Spectroscopy.pptx food analysis technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Machine learning based COVID-19 study performance prediction
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation_ Review paper, used for researhc scholars
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
“AI and Expert System Decision Support & Business Intelligence Systems”
20250228 LYD VKU AI Blended-Learning.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
The AUB Centre for AI in Media Proposal.docx
Advanced methodologies resolving dimensionality complications for autism neur...
Understanding_Digital_Forensics_Presentation.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Spectroscopy.pptx food analysis technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
sap open course for s4hana steps from ECC to s4
Programs and apps: productivity, graphics, security and other tools
NewMind AI Weekly Chronicles - August'25 Week I
Machine learning based COVID-19 study performance prediction

Introduction To MongoDB

  • 2. But First, A Little About MeMy name’s Lee Theobald. Hello!Twitter: @LeesyNever updated blog: http://www.ltheobald.co.uk/I’m a developer at a small search company in Cambridge called Open Objects.
  • 3. So what is MongoDB?
  • 4. NoSQL databaseThe name is short for humongousOpen source with development lead by 10Gen (http://www.10gen.com)Document BasedSchema-lessHighly ScalableMapReduceReplication & Auto Sharding
  • 5. Document StoreData is stored in the form of JSON data.{"_id" : ObjectId("4ccbfc75bd163019417c27f8"),"title": “Hello World! ","author": {"firstname": "Joe","lastname": "Bloggs" },"tags": ["test", "foo", "bar"]}
  • 6. Familiar StructureMongoDB instances contain a number of databases which in turn contain a number of collections.Think of MySQL with it’s databases & tables.But collections can also be nested. E.g.customer_a(Database)logs_201009 (Collection)top_queries(Collection)
  • 7. Inserts – Easy As Pie!use cookbook;db.desserts.save({ name: "Cherry Pie", ingredients: ["cherries", "pie"],cooking_time: 30});
  • 8. Searching – A Piece Of Cakedb.recipes.find({cooking_time: { “$gte”: 10, “$lt”: 30}})db.recipes.findOne()
  • 9. Some More Advanced Query SyntaxLimitingdb.find().limit(10);Skippingdb.find( ).skip(5);Sortingdb.find({…}).sort({cooking_time: “-1”});Cursorsvar cur = db.find({…}).cursor()cur.forEach( function(x) { print(tojson(x)) });
  • 10. MapReduceGreat way of doing bulk manipulation or aggregation.2 or 3 functions written in JavaScriptthat execute on the server.An example use could be generating a list of top queries from some search logs.
  • 11. Map FunctionTakes some input of the form of key/value pairs.Does something with thatReturns 0 or more key/value pairsmap = function() { if (!this.query) { return; } emit (this.query, {count: 1});}
  • 12. Reduce FunctionTakes the results from the map functionDoes something (normally combine the results)Produces output in key/value pairsreduce = function(key, values) {var count = 0;values.forEach(function(v) { count += v[‘count’]; } return {count: count;}}
  • 13. Replica SetsMaster/Slave configurationIf your primary server goes down, one of the secondary ones takes over.
  • 15. But Why Not Try It YourselfDownload it at: http://www.mongodb.orgOnline tutorial at:http://www.mongodb.org/display/DOCS/TutorialSome handy MongoDB sites:MongoDB Cookbook: http://cookbook.mongodb.org/Kyle Banker’s blog: http://kylebanker.com/blog/
  • 16. Thanks For Listening.Any (easy)Questions?