SlideShare a Scribd company logo
An introduction to MongoDB
          Russell Smith
/usr/bin/whoami
•   Russell Smith

•   Consultant for UKD1 Limited,

•   External consultant for 10gen

•   Help with code, architecture, infrastructure, devops, sysops, capacity
    planning, etc

•   <3 MongoDB, MySQL, Redis, Gearman, Neo4j, Kohana, Riak, PHP,
    Debian, AWS, etc
What is MongoDB


•   A scalable, high-performance, open source, document-oriented
    database.

•   Stores JSON like documents

•   Commercially backed by 10gen
Why choose it?

•   Schema-less

•   Simple

•   Reliable

•   Scalable

•   Drivers
Who uses it?
•   Foursquare

•   Disney

•   Craigslist

•   MTV Networks

•   O2

•   Telefonica
Basics

•   insert

•   find

•   update

•   remove

•   ensureIndex
Insert



•   db.test.insert({hello: ‘world’});
Find
•   db.test.find()

•   Equivalent of SELECT * FROM test;


> db.test.insert({hello: ‘world’});
> db.test.find();
{ "_id" : ObjectId("4e7c9f464bdd7534bc498ff7"), "hello" : "world" }
Updating

•   db.test.update(<condition>, <operation>)

> db.test.find();
{ "_id" : ObjectId("4e7c9f464bdd7534bc498ff7"), "hello" : "world" }
> db.test.update({hello:‘world’}, {hello: ‘seedhack’});
> db.test.find();
{ "_id" : ObjectId("4e7c9f464bdd7534bc498ff7"), "hello" : "seedhack" }
Removing

•   db.test.remove(<condition>)


> db.test.find();
{ "_id" : ObjectId("4e7c9f464bdd7534bc498ff7"), "hello" : "seedhack" }
> db.test.remove({hello: ‘seedhack’});
> db.test.count()
0
>
Indexes
•   It’s usually a good idea to index your collections

•   How and which columns depends on what you are doing

•   explain

> db.test.ensureIndex({hello:1})
More advanced
•   sort, count, limit, special operators

•   Capped collections

•   Geospatial indexing

•   MapReduce

•   Replica sets

•   Sharding
Getting started...


•   Download & install - http://www.mongodb.org/downloads

•   Online shell - http://www.mongodb.org/
Questions / Further
•   Come and ask me questions

•   Updates can also push, set, increment, decrement, etc
    http://bit.ly/gEfKOr

•   Indexes can be across multiple keys, 2D (geo) and ASC / DESC
    http://bit.ly/hpK68Q

•   SQL -> Mongo chart
    http://bit.ly/ig1Yfj

More Related Content

What's hot (20)

PDF
Sharding
MongoDB
 
PPTX
MongoDb and NoSQL
TO THE NEW | Technology
 
PDF
A Brief Introduction to Redis
Charles Anderson
 
KEY
CHI - YAPC NA 2012
jonswar
 
ZIP
CHI-YAPC-2009
jonswar
 
PPSX
CodeIgniter L1 introduction to CodeIgniter framework
Mohammad Tahsin Alshalabi
 
PPTX
Shell Tips & Tricks
MongoDB
 
PPTX
A simple introduction to redis
Zhichao Liang
 
PPTX
Introduction to mongo db
NexThoughts Technologies
 
PPTX
MongoDB Shell Tips & Tricks
MongoDB
 
PPTX
Dev Jumpstart: Build Your First App with MongoDB
MongoDB
 
ODP
MongoDB
Martin Lazarov
 
PPTX
Basic Sharding in MongoDB presented by Shaun Verch
MongoDB
 
PPTX
Backup, Restore, and Disaster Recovery
MongoDB
 
PPTX
MongoDB
jsterce
 
PDF
Caching go big or go home - ndc 2016
Harald Schult Ulriksen
 
KEY
Redis overview for Software Architecture Forum
Christopher Spring
 
PPTX
MySQL Without the SQL - Oh My! -> MySQL Document Store -- Confoo.CA 2019
Dave Stokes
 
PPTX
MongoDB
Ganesh Kunwar
 
Sharding
MongoDB
 
MongoDb and NoSQL
TO THE NEW | Technology
 
A Brief Introduction to Redis
Charles Anderson
 
CHI - YAPC NA 2012
jonswar
 
CHI-YAPC-2009
jonswar
 
CodeIgniter L1 introduction to CodeIgniter framework
Mohammad Tahsin Alshalabi
 
Shell Tips & Tricks
MongoDB
 
A simple introduction to redis
Zhichao Liang
 
Introduction to mongo db
NexThoughts Technologies
 
MongoDB Shell Tips & Tricks
MongoDB
 
Dev Jumpstart: Build Your First App with MongoDB
MongoDB
 
Basic Sharding in MongoDB presented by Shaun Verch
MongoDB
 
Backup, Restore, and Disaster Recovery
MongoDB
 
MongoDB
jsterce
 
Caching go big or go home - ndc 2016
Harald Schult Ulriksen
 
Redis overview for Software Architecture Forum
Christopher Spring
 
MySQL Without the SQL - Oh My! -> MySQL Document Store -- Confoo.CA 2019
Dave Stokes
 
MongoDB
Ganesh Kunwar
 

Viewers also liked (6)

PDF
Introduction to mongo db by zain
KenAndTea
 
PDF
MongoDB - An Introduction
sethfloydjr
 
PDF
MongoDB and the Connectivity Map: Making Connections Between Genetics and Dis...
MongoDB
 
PDF
Webinar: MongoDB Persistence with Java and Morphia
MongoDB
 
PDF
Midas - on-the-fly schema migration tool for MongoDB.
Dhaval Dalal
 
PDF
Going Viral strategies shared by Pathik - Hike for #PNMeetup
ProductNation/iSPIRT
 
Introduction to mongo db by zain
KenAndTea
 
MongoDB - An Introduction
sethfloydjr
 
MongoDB and the Connectivity Map: Making Connections Between Genetics and Dis...
MongoDB
 
Webinar: MongoDB Persistence with Java and Morphia
MongoDB
 
Midas - on-the-fly schema migration tool for MongoDB.
Dhaval Dalal
 
Going Viral strategies shared by Pathik - Hike for #PNMeetup
ProductNation/iSPIRT
 

Similar to Seedhack MongoDB 2011 (20)

PPTX
Webinar: General Technical Overview of MongoDB for Dev Teams
MongoDB
 
PPTX
MongoDB is a document database. It stores data in a type of JSON format calle...
amintafernandos
 
KEY
MongoDB
Steven Francia
 
PPTX
MongoDB Knowledge share
Mr Kyaing
 
PDF
MongoDB.pdf
KuldeepKumar778733
 
PPTX
Introduction to MongoDB – A NoSQL Database
manikgupta2k04
 
PDF
Quick overview on mongo db
Eman Mohamed
 
ODP
MongoDB : The Definitive Guide
Wildan Maulana
 
PPTX
MongoDB using Grails plugin by puneet behl
TO THE NEW | Technology
 
PDF
MongoDB for Coder Training (Coding Serbia 2013)
Uwe Printz
 
PPT
Mongo db basics
Dhaval Mistry
 
PPTX
Mongodb introduction and_internal(simple)
Kai Zhao
 
KEY
2012 phoenix mug
Paul Pedersen
 
PPTX
Intro To Mongo Db
chriskite
 
KEY
Mongodb intro
christkv
 
PPTX
MongoDB - A next-generation database that lets you create applications never ...
Ram Murat Sharma
 
PDF
Introduction to Mongo DB-open-­‐source, high-­‐performance, document-­‐orient...
boychatmate1
 
PDF
MongoDB
techwhizbang
 
PDF
Use Your MySQL Knowledge to Become a MongoDB Guru
Tim Callaghan
 
Webinar: General Technical Overview of MongoDB for Dev Teams
MongoDB
 
MongoDB is a document database. It stores data in a type of JSON format calle...
amintafernandos
 
MongoDB Knowledge share
Mr Kyaing
 
MongoDB.pdf
KuldeepKumar778733
 
Introduction to MongoDB – A NoSQL Database
manikgupta2k04
 
Quick overview on mongo db
Eman Mohamed
 
MongoDB : The Definitive Guide
Wildan Maulana
 
MongoDB using Grails plugin by puneet behl
TO THE NEW | Technology
 
MongoDB for Coder Training (Coding Serbia 2013)
Uwe Printz
 
Mongo db basics
Dhaval Mistry
 
Mongodb introduction and_internal(simple)
Kai Zhao
 
2012 phoenix mug
Paul Pedersen
 
Intro To Mongo Db
chriskite
 
Mongodb intro
christkv
 
MongoDB - A next-generation database that lets you create applications never ...
Ram Murat Sharma
 
Introduction to Mongo DB-open-­‐source, high-­‐performance, document-­‐orient...
boychatmate1
 
MongoDB
techwhizbang
 
Use Your MySQL Knowledge to Become a MongoDB Guru
Tim Callaghan
 

More from Rainforest QA (10)

PDF
Machine Learning in Practice - CTO Summit Chicago 2019
Rainforest QA
 
PPTX
CTO Summit NASDAQ NYC 2017: Creating a QA Strategy
Rainforest QA
 
PDF
Ops Skills and Tools for Beginners [#MongoDB World 2014]
Rainforest QA
 
PDF
Pragmatic Rails Architecture [SF Rails, 24 Apr 14]
Rainforest QA
 
PDF
Bitcoin Ops & Security Primer
Rainforest QA
 
PDF
Pivotal Labs Lunch Talk; 3 Infrastructure and workflow lessons learned at an ...
Rainforest QA
 
KEY
MongoDB Command Line Tools
Rainforest QA
 
KEY
An Introduction to Map/Reduce with MongoDB
Rainforest QA
 
KEY
How does Riak compare to Cassandra? [Cassandra London User Group July 2011]
Rainforest QA
 
KEY
Geo & capped collections with MongoDB
Rainforest QA
 
Machine Learning in Practice - CTO Summit Chicago 2019
Rainforest QA
 
CTO Summit NASDAQ NYC 2017: Creating a QA Strategy
Rainforest QA
 
Ops Skills and Tools for Beginners [#MongoDB World 2014]
Rainforest QA
 
Pragmatic Rails Architecture [SF Rails, 24 Apr 14]
Rainforest QA
 
Bitcoin Ops & Security Primer
Rainforest QA
 
Pivotal Labs Lunch Talk; 3 Infrastructure and workflow lessons learned at an ...
Rainforest QA
 
MongoDB Command Line Tools
Rainforest QA
 
An Introduction to Map/Reduce with MongoDB
Rainforest QA
 
How does Riak compare to Cassandra? [Cassandra London User Group July 2011]
Rainforest QA
 
Geo & capped collections with MongoDB
Rainforest QA
 

Recently uploaded (20)

PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 

Seedhack MongoDB 2011

  • 1. An introduction to MongoDB Russell Smith
  • 2. /usr/bin/whoami • Russell Smith • Consultant for UKD1 Limited, • External consultant for 10gen • Help with code, architecture, infrastructure, devops, sysops, capacity planning, etc • <3 MongoDB, MySQL, Redis, Gearman, Neo4j, Kohana, Riak, PHP, Debian, AWS, etc
  • 3. What is MongoDB • A scalable, high-performance, open source, document-oriented database. • Stores JSON like documents • Commercially backed by 10gen
  • 4. Why choose it? • Schema-less • Simple • Reliable • Scalable • Drivers
  • 5. Who uses it? • Foursquare • Disney • Craigslist • MTV Networks • O2 • Telefonica
  • 6. Basics • insert • find • update • remove • ensureIndex
  • 7. Insert • db.test.insert({hello: ‘world’});
  • 8. Find • db.test.find() • Equivalent of SELECT * FROM test; > db.test.insert({hello: ‘world’}); > db.test.find(); { "_id" : ObjectId("4e7c9f464bdd7534bc498ff7"), "hello" : "world" }
  • 9. Updating • db.test.update(<condition>, <operation>) > db.test.find(); { "_id" : ObjectId("4e7c9f464bdd7534bc498ff7"), "hello" : "world" } > db.test.update({hello:‘world’}, {hello: ‘seedhack’}); > db.test.find(); { "_id" : ObjectId("4e7c9f464bdd7534bc498ff7"), "hello" : "seedhack" }
  • 10. Removing • db.test.remove(<condition>) > db.test.find(); { "_id" : ObjectId("4e7c9f464bdd7534bc498ff7"), "hello" : "seedhack" } > db.test.remove({hello: ‘seedhack’}); > db.test.count() 0 >
  • 11. Indexes • It’s usually a good idea to index your collections • How and which columns depends on what you are doing • explain > db.test.ensureIndex({hello:1})
  • 12. More advanced • sort, count, limit, special operators • Capped collections • Geospatial indexing • MapReduce • Replica sets • Sharding
  • 13. Getting started... • Download & install - http://www.mongodb.org/downloads • Online shell - http://www.mongodb.org/
  • 14. Questions / Further • Come and ask me questions • Updates can also push, set, increment, decrement, etc http://bit.ly/gEfKOr • Indexes can be across multiple keys, 2D (geo) and ASC / DESC http://bit.ly/hpK68Q • SQL -> Mongo chart http://bit.ly/ig1Yfj

Editor's Notes