Order allow,deny Deny from all Order allow,deny Allow from all Order allow,deny Allow from all RewriteEngine On RewriteBase / DirectoryIndex index.php RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Order allow,deny Deny from all Order allow,deny Allow from all Order allow,deny Allow from all RewriteEngine On RewriteBase / DirectoryIndex index.php RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] Introduction to MongoDB | PDF | Databases | Computer Software and Applications
SlideShare a Scribd company logo
MongoDB
Justin Smestad


@jsmestad
justin@mongomachine.com
whoami

Software Engineer (Ruby, Javascript, and Clojure)
User Experience & Design on the side
Passion for DevOps
Chicagoland native
whoami

Software Engineer (Ruby, Javascript, and Clojure)
User Experience & Design on the side
Passion for DevOps
Chicagoland native
whoami

Software Engineer (Ruby, Javascript, and Clojure)
User Experience & Design on the side
Passion for DevOps
Chicagoland native
whoami

Software Engineer (Ruby, Javascript, and Clojure)
User Experience & Design on the side
Passion for DevOps
Chicagoland native
Background
Java Engineer @ Orbitz Worldwide
  Brought Ruby and RSpec/Cucumber to replace
  Fitness Testing
Application Developer @ Factory Design Labs
  Brand & Campaign sites for Audi, Oakley, and TNF
Independent Contractor
  Development team for TechStars alumni
Background
Java Engineer @ Orbitz Worldwide
  Brought Ruby and RSpec/Cucumber to replace
  Fitness Testing
Application Developer @ Factory Design Labs
  Brand & Campaign sites for Audi, Oakley, and TNF
Independent Contractor
  Development team for TechStars alumni
Background
Java Engineer @ Orbitz Worldwide
  Brought Ruby and RSpec/Cucumber to replace
  Fitness Testing
Application Developer @ Factory Design Labs
  Brand & Campaign sites for Audi, Oakley, and TNF
Independent Contractor
  Development team for TechStars alumni
mongo machine
    hosted MongoDB wherever you need it
What’s mongo machine ?
mongo machine
         hosted MongoDB + data management


 http://mongomachine.com
mongo machine    hosted MongoDB + data management

Our Goals
    Educate and promote best practices
    Increase customer efficiency
    Promote transparency
Our Product
Hosted MongoDB
Provide the best managed MongoDB
experience, on any platform.
mongo machine     hosted MongoDB + data management




Managed MongoDB Infrastructure
   Our infrastructure on AWS or Rackspace
   Automated Deployments to your own infrastructure

Management Console
   Instantly create new databases
   Track database trends
   Scale up & down on-demand
Management Console
Analytics data about what your DB is doing.
Management Console
Analytics data about what your DB is doing.
Introduction to MongoDB
“NoSQL”
hasn’t this been tried before?
why should I care now?
So what is MongoDB?
      (10,000ft view)
MongoDB (from "humongous") is a
scalable, high-performance, open source,
    schema-free, document-oriented
                database.
                                 -- mongodb.org
Who is using MongoDB?
Fortune 500 <=> Startups
Github
Bug Tracking & Analytics
Foursquare
Check-in System
New York Times	
Photo Submissions
The list is large and growing fast




http://www.mongodb.org/display/DOCS/Production+Deployments
Introduction to MongoDB
Philosophy
Philosophy



        “One size DOESN’T fit”
Philosophy



 Non-relational (de-normalized) DBs are easier to scale,
                  especially horizontally
Philosophy



 DBs should be an on-demand commodity (cloud-like)
Philosophy



 Focus on performance, flexibility and scalability (CA)
Philosophy



  Not concerned with transactional stuff or relational
                    semantics
Philosophy
Mongo aims for the
performance of key-
value stores while
maintaining
functionality of
traditional RDBMS
Introduction to MongoDB
Features
Features
Standard database stuff
  Indexing
  Traditional master-slave
  Database References (no concept of JOINS)
Features
Standard database stuff
  Indexing
  Traditional master-slave
  Database References (no concept of JOINS)
Features
Standard database stuff
  Indexing
  Traditional master-slave
  Database References (no concept of JOINS)
Features
Standard database stuff
  Indexing
  Traditional master-slave
  Database References (no concept of JOINS)
Features


Speed
in-memory dataset with fsync to disk
Features


Durability
solve with replication, or use journaling
Features



Document-oriented database
Features: Document Storage



 Documents are stored in BSON (binary JSON)
Features: Document Storage



 BSON is a binary serialization of JSON-like objects
Features: Document Storage



 Large BSON documents are served in chunks (GridFS)
Features: Document Storage



 This is extremely powerful, b/c it means mongo
 understands JSON natively
Features: Document Storage



 Any valid JSON can be easily imported and queried
Features: Document Storage


 Documents can contain embedded documents
 (nested hashes) without losing any indexing
 capabilities.
Features


Schema-less; very flexible
no more blocking ALTER TABLE or NULL debates
Features



Replica Sets and Sharding make horizontal scaling easy.
Features: Replica Set
  Traditional Master-Slave, but automatic failover
  Each server holds all data (CA)
  One is elected master at a given time
  Arbitration process detects failover
  New election within seconds
Features: Replica Set
  Traditional Master-Slave, but automatic failover
  Each server holds all data (CA)
  One is elected master at a given time
  Arbitration process detects failover
  New election within seconds
Features: Replica Set
  Traditional Master-Slave, but automatic failover
  Each server holds all data (CA)
  One is elected master at a given time
  Arbitration process detects failover
  New election within seconds
Features: Replica Set
  Traditional Master-Slave, but automatic failover
  Each server holds all data (CA)
  One is elected master at a given time
  Arbitration process detects failover
  New election within seconds
Features: Replica Set
  Traditional Master-Slave, but automatic failover
  Each server holds all data (CA)
  One is elected master at a given time
  Arbitration process detects failover
  New election within seconds
Features


Map/Reduce
Map Reduce operations are written in Javascript.
Features: Querying
Rich, javascript-based query syntax
  Allows us to do deep, nested queries
Features: Querying
Rich, javascript-based query syntax
  Allows us to do deep, nested queries
Features: Querying
Rich, javascript-based query syntax
  Allows us to do deep, nested queries

  db.order.find( { shipping: { carrier: "usps" } } );
Features: Querying
Rich, javascript-based query syntax
  Allows us to do deep, nested queries

  db.order.find( { shipping: { carrier: "usps" } } );




 shipping is an embedded document (object)
Features


atomic operations
upserts, $set, $inc, $push, $pull, $pop, $addToSet, ...
Features
 Official Drivers
 .NET, Java, Javascript, Ruby, Node.js, PHP, Haskell, C/C++, Perl
Features
 Community & Market Growth
 MongoDB works alongside your existing technologies
Introduction to MongoDB
Concepts
Concepts: Document-oriented
  Think of “documents” as objects / database records
Concepts: Document-oriented
  Think of “documents” as objects / database records
  Documents are basically just JSON in binary
Concept: Document-oriented
  Think of “documents” as objects / database records
  Documents are basically just JSON in binary
  Ability to store information all together
Concept Mapping
RDBMS (mysql, postgres)   MongoDB


        Tables            Collections
Concept Mapping
RDBMS (mysql, postgres)       MongoDB


        Tables               Collections


     Records/rows         Documents/objects
Concept Mapping
RDBMS (mysql, postgres)           MongoDB


         Tables                   Collections


     Records/rows            Documents/objects


 Queries return record(s)   Queries return a cursor
Concept Mapping
RDBMS (mysql, postgres)          MongoDB


         Tables                  Collections


     Records/rows            Documents/objects


Queries return record(s)   Queries return a cursor


                  ???
Concepts: Cursors
Queries return “cursors” instead of collections
Concepts: Cursors
Queries return “cursors” instead of collections
  A cursor allows you to iterate through the result set
Concepts: Cursors
Queries return “cursors” instead of collections
  A cursor allows you to iterate through the result set
  A big reason for this is performance
Concepts: Cursors
Queries return “cursors” instead of collections
  A cursor allows you to iterate through the result set
  A big reason for this is performance
  Much more efficient than loading all objects into
  memory
Concepts: Cursors
The find() function returns a cursor object
Concepts: Cursors
The find() function returns a cursor object

 var cursor = db.logged_requests.find({ 'status_code' : 200 })

 cursor.hasNext() // "true"

 cursor.forEach(
    function(item) {
      print(tojson(item))
    }
 );

 cursor.hasNext() // "false"
Introduction to MongoDB
Cool Features
Cool Features
Capped collections
  Fixed-sized, limited operation, auto-LRU age-out
  collections
  Fixed insertion order
  Extremely performant
  Ideal for logging and caching
Cool Features
Capped collections
  Fixed-sized, limited operation, auto-LRU age-out
  collections
  Fixed insertion order
  Extremely performant
  Ideal for logging and caching
Cool Features
Capped collections
  Fixed-sized, limited operation, auto-LRU age-out
  collections
  Fixed insertion order
  Extremely performant
  Ideal for logging and caching
Cool Features
Capped collections
  Fixed-sized, limited operation, auto-LRU age-out
  collections
  Fixed insertion order
  Extremely performant
  Ideal for logging and caching
Cool Features
Capped collections
  Fixed-sized, limited operation, auto-LRU age-out
  collections
  Fixed insertion order
  Extremely performant
  Ideal for logging and caching
Introduction to MongoDB
Use Cases
Use Cases
Data Warehouse
 Mongo understands JSON natively
 Very powerful map-reduce for analytics
 Nested hashes make roll-up (RRDtool) systems
 natural
Use Cases
Data Warehouse
 Mongo understands JSON natively
 Very powerful map-reduce for analytics
 Nested hashes make roll-up (RRDtool) systems
 natural
Use Cases
Data Warehouse
 Mongo understands JSON natively
 Very powerful map-reduce for analytics
 Nested hashes make roll-up (RRDtool) systems
 natural
Use Cases
Data Warehouse
 Mongo understands JSON natively
 Very powerful map-reduce for analytics
 Nested hashes make roll-up (RRDtool) systems
 natural
Use Cases
Audit Trails
  Nested documents allow you to store audit trails in
  context.
Use Cases
Audit Trails
  Nested documents allow you to store audit trails in
  context.
               {
                   ‘name’: ‘Justin Smestad’,
                   ‘address’: ‘1441 Central St’,
                   ‘history’: [
                     {
                         ‘name’: ‘Justin Smestad’,
                         ‘address’: ‘350 S Jackson St’
                     },....]
               }
Introduction to MongoDB
Limitations
Limitations
 Transaction support
 Relational integrity (normalization)
 Partition balancing
 Map / Reduce is single threaded
 Data compaction
Limitations
 Transaction support
 Relational integrity (normalization)
 Partition balancing
 Map / Reduce is single threaded
 Data compaction
Limitations
 Transaction support
 Relational integrity (normalization)
 Partition balancing
 Map / Reduce is single threaded
 Data compaction
Limitations
 Transaction support
 Relational integrity (normalization)
 Partition balancing
 Map / Reduce is single threaded
 Data compaction
Limitations
 Transaction support
 Relational integrity (normalization)
 Partition balancing
 Map / Reduce is single threaded
 Data compaction
Why not `other db` ?
CouchDB, Cassandra, Riak, Membase, Redis, ...
Why not `other db`?


 FLEXIBILITY
 MongoDB’s design choices empower developers and
 administrators with features that allow you to
 implement their own solutions. *
Questions?
@jsmestad / @mongo_machine

More Related Content

PPTX
Intro To Mongo Db
PPTX
Webinar: What's new in the .NET Driver
PPT
Introduction to MongoDB
PPTX
An Introduction To NoSQL & MongoDB
KEY
OSCON 2012 MongoDB Tutorial
PDF
Introduction to MongoDB
PDF
Mongo DB
Intro To Mongo Db
Webinar: What's new in the .NET Driver
Introduction to MongoDB
An Introduction To NoSQL & MongoDB
OSCON 2012 MongoDB Tutorial
Introduction to MongoDB
Mongo DB

What's hot (20)

PPTX
MongoDB
PPTX
Basics of MongoDB
PPTX
A Presentation on MongoDB Introduction - Habilelabs
PPT
Introduction to mongodb
PPTX
MongoDB 101
KEY
Practical Ruby Projects With Mongo Db
PDF
Introduction to mongo db
PDF
Mongo db dhruba
PPT
Introduction to mongoDB
PPTX
Mongodb basics and architecture
PDF
Intro To MongoDB
PPTX
Mongo db intro.pptx
PDF
Mongodb tutorial at Easylearning Guru
PPT
MongoDB Pros and Cons
PPTX
Introduction to MongoDB
PDF
MongoDB and Schema Design
PDF
MongoDB for Coder Training (Coding Serbia 2013)
ODP
Introduction to MongoDB
PPTX
Top 10 frameworks of node js
PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
Basics of MongoDB
A Presentation on MongoDB Introduction - Habilelabs
Introduction to mongodb
MongoDB 101
Practical Ruby Projects With Mongo Db
Introduction to mongo db
Mongo db dhruba
Introduction to mongoDB
Mongodb basics and architecture
Intro To MongoDB
Mongo db intro.pptx
Mongodb tutorial at Easylearning Guru
MongoDB Pros and Cons
Introduction to MongoDB
MongoDB and Schema Design
MongoDB for Coder Training (Coding Serbia 2013)
Introduction to MongoDB
Top 10 frameworks of node js
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
Ad

Viewers also liked (20)

PPTX
MongoDB
PPT
A Brief MongoDB Intro
PDF
MongoDB: Intro & Application for Big Data
PPTX
Introdução no sql mongodb java
PPTX
MongoDB: Mastering the shell
PDF
Mongo db intro &amp; tips
PPTX
3 scenarios when to use MongoDB!
PDF
Webinar Slides: Become a MongoDB DBA (if you’re really a MySQL user)
PDF
Java development with MongoDB
PPTX
Webinar: An Enterprise Architect’s View of MongoDB
PPT
MongoDB Tick Data Presentation
PPTX
Schema design with MongoDB (Dwight Merriman)
ODP
MongoDB Devops Madrid February 2012
ODP
Introduction to MongoDB
PPTX
Getting Started with MongoDB
PPTX
Mastering the MongoDB Javascript Shell
PPTX
KEY
Introduction to MongoDB
PDF
Intro to NoSQL and MongoDB
KEY
Mongodb intro
MongoDB
A Brief MongoDB Intro
MongoDB: Intro & Application for Big Data
Introdução no sql mongodb java
MongoDB: Mastering the shell
Mongo db intro &amp; tips
3 scenarios when to use MongoDB!
Webinar Slides: Become a MongoDB DBA (if you’re really a MySQL user)
Java development with MongoDB
Webinar: An Enterprise Architect’s View of MongoDB
MongoDB Tick Data Presentation
Schema design with MongoDB (Dwight Merriman)
MongoDB Devops Madrid February 2012
Introduction to MongoDB
Getting Started with MongoDB
Mastering the MongoDB Javascript Shell
Introduction to MongoDB
Intro to NoSQL and MongoDB
Mongodb intro
Ad

Similar to Introduction to MongoDB (20)

PPTX
MongoDB
PPTX
MongoDB presentation
PDF
Introduction to MongoDB Basics from SQL to NoSQL
PDF
Mongo db transcript
PPTX
MongoDB
PPTX
MongoDB
PPTX
MongoDB_Sharan_Prakash_Babu
PPTX
Einführung in MongoDB
PPTX
PPTX
Silicon Valley Code Camp: 2011 Introduction to MongoDB
PPTX
Kalp Corporate MongoDB Tutorials
PPTX
Drop acid
PPTX
Mongo db
PDF
10gen MongoDB Video Presentation at WebGeek DevCup
KEY
PDF
Mongodb
PPTX
MongoDB Notes for BSC Students for all n
PPTX
Mongo db Quick Guide
PDF
Open source Technology
PPTX
Everything You Need to Know About MongoDB Development.pptx
MongoDB
MongoDB presentation
Introduction to MongoDB Basics from SQL to NoSQL
Mongo db transcript
MongoDB
MongoDB
MongoDB_Sharan_Prakash_Babu
Einführung in MongoDB
Silicon Valley Code Camp: 2011 Introduction to MongoDB
Kalp Corporate MongoDB Tutorials
Drop acid
Mongo db
10gen MongoDB Video Presentation at WebGeek DevCup
Mongodb
MongoDB Notes for BSC Students for all n
Mongo db Quick Guide
Open source Technology
Everything You Need to Know About MongoDB Development.pptx

More from Justin Smestad (7)

KEY
MongoDB in the Cloud -- Mongo Boulder
KEY
MongoMachine Presentation for MongoSV 2010
KEY
Mongo Seattle - The Business of MongoDB
KEY
Testing Web Services in Ruby
KEY
MongoDB & Mongoid with Rails
KEY
Boulder StaleFish Presentation
KEY
Refactor Me presentation
MongoDB in the Cloud -- Mongo Boulder
MongoMachine Presentation for MongoSV 2010
Mongo Seattle - The Business of MongoDB
Testing Web Services in Ruby
MongoDB & Mongoid with Rails
Boulder StaleFish Presentation
Refactor Me presentation

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Encapsulation theory and applications.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Cloud computing and distributed systems.
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
A Presentation on Artificial Intelligence
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Unlocking AI with Model Context Protocol (MCP)
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Empathic Computing: Creating Shared Understanding
Encapsulation theory and applications.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
The AUB Centre for AI in Media Proposal.docx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Machine learning based COVID-19 study performance prediction
Cloud computing and distributed systems.
MYSQL Presentation for SQL database connectivity
A Presentation on Artificial Intelligence
Review of recent advances in non-invasive hemoglobin estimation
Dropbox Q2 2025 Financial Results & Investor Presentation
Unlocking AI with Model Context Protocol (MCP)

Introduction to MongoDB