SlideShare a Scribd company logo
open-source, high-performance,
schema-free, document-oriented
           database
RDBMS

• Great for many applications
• Shortcomings
 • Scalability
 • Flexibility
CAP Theorem

• Consistency
• Availability
• Tolerance to network Partitions
• Pick two

       http://www.cs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf
ACID vs BASE

•   Atomicity
                  •   Basically Available
•   Consistency
                  •   Soft state
•   Isolation
                  •   Eventually consistent
•   Durability
Schema-free

• Loosening constraints - added flexibility
• Dynamically typed languages
• Migrations
BigTable

• Single master node
• Row / Column hybrid
• Versioned
BigTable

• Open-source clones:
 • HBase
 • Hypertable
Dynamo
• Simple Key/Value store
• No master node
 • Write to any (many) nodes
 • Read from one or more nodes (balance
    speed vs. consistency)
• Read repair
Dynamo

• Open-source clones
 • Project Voldemort
 • Cassandra - data model more like
    BigTable
 • Dynomite
memcached

• Used as a caching layer
• Essentially a key/value store
• RAM only - fast
• Does away with ACID
Redis

• Like memcached
• Different
 • Values can be strings, lists, sets
 • Non-volatile
Tokyo Cabinet + Tyrant

• Key/value store with focus on speed
• Some more advanced queries
 • Sorting, range or prefix matching
• Multiple storage engines
 • Hash, B-Tree, Fixed length and Table
• A lot in common with MongoDB:
 • Document-oriented
 • Schema-free
 • JSON-style documents
• Differences
 • MVCC based
 • Replication as path to scalability
 • Query through predefined views
 • ACID
 • REST
• Focus on performance
• Rich dynamic queries
• Secondary indexes
• Replication / failover
• Auto-sharding
• Many platforms / languages supported
MongoDB SF Python
Good at

• The web
• Caching
• High volume / low value
• Scalability
Less good at

• Highly transactional
• Ad-hoc business intelligence
• Problems that require SQL
PyMongo

• Python driver for MongoDB
• Pure Python, with optional C extension
• Installation
 • Use setuptools:
         easy_install pymongo
Basics
• Connect:

• Insert:

• Query:
Document values
•   None
                        •   Special values:
•   bool
                            •   SON
•   int
                            •   Binary
•   float
                            •   ObjectId
•   string / unicode
                            •   DBRef
•   dict

•   datetime.datetime

•   compiled re
• Schema-free:


• Query with selectors:
Advanced queries
• Sorting:

• Limit:

• Range:
• $gt, $lt, $gte, $lte, $ne, $all, $in, $nin
• where()


• count()
• group()
GridFS
• File storage in MongoDB
• File-like API for Python
• Initialize:

• Write:

• Read:
Other cool stuff

• Capped collections
• Upserts
• Multikeys
Demo
• Download MongoDB
  http://www.mongodb.org

• Install PyMongo
• Try it out!
• http://www.mongodb.org
• irc.freenode.net#mongodb
• mongodb-user on google groups
• @mongodb
• mike@10gen.com

More Related Content

What's hot (20)

PPTX
MongoDB and MongoMK Source Event
Yuval Ararat
 
PDF
Performance (browser)
aquarius070287
 
PDF
Redis
Hung-yu Lin
 
PDF
BuilHigh Performance Weibo Platform-Qcon2011
Yiwei Ma
 
PPTX
Basic Website 101
Thomas Salmen
 
KEY
MongoDB Strange Loop 2009
Mike Dirolf
 
KEY
Redis
Ramon Wartala
 
PDF
Introduction to PalDB
Mathieu Bastian
 
PPTX
Vlad zelinschi optimizing the critical rendering path
Codecamp Romania
 
PDF
A step away from RDBMS
Dimitri Krassovski
 
PPTX
Brief overview of TypeScript - Ljubljana JavaScript Users Group
Peter A. Pirc
 
PDF
CouchDB: replicated data store for distributed proxy server
tkramar
 
PPT
Intro ror
tim_tang
 
PDF
Java Memory Structure
Haim Yadid
 
PDF
MongoDB vs OrientDB
Stefano Campese
 
PPTX
mongodb_Introduction
Vikas Pratap Singh
 
PPTX
Omeka.net, briefly
Kathryn Knight
 
PDF
Introduction to Web Designing
Kailaash Balachandran
 
PPTX
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
Sunny Sharma
 
PDF
Scala.io
Diego Pacheco
 
MongoDB and MongoMK Source Event
Yuval Ararat
 
Performance (browser)
aquarius070287
 
BuilHigh Performance Weibo Platform-Qcon2011
Yiwei Ma
 
Basic Website 101
Thomas Salmen
 
MongoDB Strange Loop 2009
Mike Dirolf
 
Introduction to PalDB
Mathieu Bastian
 
Vlad zelinschi optimizing the critical rendering path
Codecamp Romania
 
A step away from RDBMS
Dimitri Krassovski
 
Brief overview of TypeScript - Ljubljana JavaScript Users Group
Peter A. Pirc
 
CouchDB: replicated data store for distributed proxy server
tkramar
 
Intro ror
tim_tang
 
Java Memory Structure
Haim Yadid
 
MongoDB vs OrientDB
Stefano Campese
 
mongodb_Introduction
Vikas Pratap Singh
 
Omeka.net, briefly
Kathryn Knight
 
Introduction to Web Designing
Kailaash Balachandran
 
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
Sunny Sharma
 
Scala.io
Diego Pacheco
 

Viewers also liked (14)

KEY
Game Design 2 (2010): Lecture 4 - Text
David Farrell
 
KEY
Game Design 2 (2010): Lecture 6 - Layering and Separation
David Farrell
 
KEY
Games Design 2 - Lecture 12 - Usability, Metaphor and Layout
David Farrell
 
KEY
Inside PyMongo - MongoNYC
Mike Dirolf
 
KEY
Game Design 2: Lecture 11 - Colour
David Farrell
 
KEY
MongoDB at RubyEnRails 2009
Mike Dirolf
 
KEY
MongoDB at ZPUGDC
Mike Dirolf
 
PPT
Game Design 2 - Lecture 2 - Menu Flow
David Farrell
 
KEY
MongoDB at RuPy
Mike Dirolf
 
KEY
Game Design 2: 2011 - Introduction to Game Interface Design
David Farrell
 
PPT
Game Design 2: Lecture 10 - UI Layout
David Farrell
 
PPTX
Dating an LDS Woman? What you need to know in 9 slides.
v_huntsman
 
KEY
MongoDB: How it Works
Mike Dirolf
 
PPT
pROCESAMIENTO DE LA INFORMACION
ROCMEL
 
Game Design 2 (2010): Lecture 4 - Text
David Farrell
 
Game Design 2 (2010): Lecture 6 - Layering and Separation
David Farrell
 
Games Design 2 - Lecture 12 - Usability, Metaphor and Layout
David Farrell
 
Inside PyMongo - MongoNYC
Mike Dirolf
 
Game Design 2: Lecture 11 - Colour
David Farrell
 
MongoDB at RubyEnRails 2009
Mike Dirolf
 
MongoDB at ZPUGDC
Mike Dirolf
 
Game Design 2 - Lecture 2 - Menu Flow
David Farrell
 
MongoDB at RuPy
Mike Dirolf
 
Game Design 2: 2011 - Introduction to Game Interface Design
David Farrell
 
Game Design 2: Lecture 10 - UI Layout
David Farrell
 
Dating an LDS Woman? What you need to know in 9 slides.
v_huntsman
 
MongoDB: How it Works
Mike Dirolf
 
pROCESAMIENTO DE LA INFORMACION
ROCMEL
 
Ad

Similar to MongoDB SF Python (20)

KEY
MongoDB SF Ruby
Mike Dirolf
 
PDF
Mongo db transcript
foliba
 
PDF
Mongodb my
Alexey Gaziev
 
PDF
MongoDB
SPBRUBY
 
KEY
MongoDB NYC Python
Mike Dirolf
 
PPTX
Drop acid
Mike Feltman
 
PDF
Chris Lea - What does NoSQL Mean for You
Carsonified Team
 
PDF
Using Spring with NoSQL databases (SpringOne China 2012)
Chris Richardson
 
PDF
MongoDB: a gentle, friendly overview
Antonio Pintus
 
PDF
Mongodb (1)
Deepak Kumar
 
PPTX
Sql vs NoSQL
RTigger
 
PDF
HPTS 2011: The NoSQL Ecosystem
Adam Marcus
 
PDF
The NoSQL Ecosystem
yarapavan
 
KEY
Nosql redis-mongo
ibelmonte
 
KEY
MongoDB - Ruby document store that doesn't rhyme with ouch
Wynn Netherland
 
PDF
No SQL Technologies
Cris Holdorph
 
KEY
NoSQL in the context of Social Web
Bogdan Gaza
 
PPTX
Introduction to NoSql
Omid Vahdaty
 
PPTX
Lviv EDGE 2 - NoSQL
zenyk
 
MongoDB SF Ruby
Mike Dirolf
 
Mongo db transcript
foliba
 
Mongodb my
Alexey Gaziev
 
MongoDB
SPBRUBY
 
MongoDB NYC Python
Mike Dirolf
 
Drop acid
Mike Feltman
 
Chris Lea - What does NoSQL Mean for You
Carsonified Team
 
Using Spring with NoSQL databases (SpringOne China 2012)
Chris Richardson
 
MongoDB: a gentle, friendly overview
Antonio Pintus
 
Mongodb (1)
Deepak Kumar
 
Sql vs NoSQL
RTigger
 
HPTS 2011: The NoSQL Ecosystem
Adam Marcus
 
The NoSQL Ecosystem
yarapavan
 
Nosql redis-mongo
ibelmonte
 
MongoDB - Ruby document store that doesn't rhyme with ouch
Wynn Netherland
 
No SQL Technologies
Cris Holdorph
 
NoSQL in the context of Social Web
Bogdan Gaza
 
Introduction to NoSql
Omid Vahdaty
 
Lviv EDGE 2 - NoSQL
zenyk
 
Ad

More from Mike Dirolf (10)

PDF
Indexing
Mike Dirolf
 
PDF
Inside MongoDB: the Internals of an Open-Source Database
Mike Dirolf
 
PDF
FrozenRails Training
Mike Dirolf
 
PDF
MongoDB at FrozenRails
Mike Dirolf
 
KEY
Python Development (MongoSF)
Mike Dirolf
 
PDF
Introduction to MongoDB
Mike Dirolf
 
KEY
MongoDB hearts Django? (Django NYC)
Mike Dirolf
 
KEY
MongoDB at CodeMash 2.0.1.0
Mike Dirolf
 
PDF
MongoDB at RubyConf
Mike Dirolf
 
KEY
MongoDB Hadoop DC
Mike Dirolf
 
Indexing
Mike Dirolf
 
Inside MongoDB: the Internals of an Open-Source Database
Mike Dirolf
 
FrozenRails Training
Mike Dirolf
 
MongoDB at FrozenRails
Mike Dirolf
 
Python Development (MongoSF)
Mike Dirolf
 
Introduction to MongoDB
Mike Dirolf
 
MongoDB hearts Django? (Django NYC)
Mike Dirolf
 
MongoDB at CodeMash 2.0.1.0
Mike Dirolf
 
MongoDB at RubyConf
Mike Dirolf
 
MongoDB Hadoop DC
Mike Dirolf
 

Recently uploaded (20)

PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PPTX
Essential Content-centric Plugins for your Website
Laura Byrne
 
PPTX
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
PPTX
Manual Testing for Accessibility Enhancement
Julia Undeutsch
 
PPTX
Talbott's brief History of Computers for CollabDays Hamburg 2025
Talbott Crowell
 
PDF
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PDF
Evolution: How True AI is Redefining Safety in Industry 4.0
vikaassingh4433
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Essential Content-centric Plugins for your Website
Laura Byrne
 
Securing Model Context Protocol with Keycloak: AuthN/AuthZ for MCP Servers
Hitachi, Ltd. OSS Solution Center.
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
Manual Testing for Accessibility Enhancement
Julia Undeutsch
 
Talbott's brief History of Computers for CollabDays Hamburg 2025
Talbott Crowell
 
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
 
Digital Circuits, important subject in CS
contactparinay1
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
Evolution: How True AI is Redefining Safety in Industry 4.0
vikaassingh4433
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 

MongoDB SF Python