SlideShare a Scribd company logo
SELECT wages FROM companies WHERE coders = “sucker”




                                  NO, NO SQL




Wednesday, 21 July 2010
Noise




Wednesday, 21 July 2010
Lots of pretty pictures to fool you.




Wednesday, 21 July 2010
Its a change




                          Its Not Relational - Get Over It.




                              It is a rich document store.




                                                             schemas for mongo : http://www.kurl.ws/wJ


Wednesday, 21 July 2010
What




                              MongoDB bridges the gap between key-value stores (which are
                              fast and highly scalable) and traditional RDBMS systems (which
                              provide rich queries and deep functionality).

                              MongoDB (from "humongous") is a scalable, high-performance,
                              open source, document-oriented database. Written in C++,
                              MongoDB features:



                          •   Document-oriented storage » JSON-style documents with dynamic schemas offer simplicity and power.
                          •   Full Index Support » Index on any attribute, just like you're used to.
                          •   Replication & High Availability »Mirror across LANs and WANs for scale and peace of mind.
                          •   Auto-Sharding » Scale horizontally without compromising functionality.
                          •   Querying » Rich, document-based queries.
                          •   Fast In-Place Updates »Atomic modifiers for contention-free performance.
                          •   Map/Reduce » Flexible aggregation and data processing.
                          •   GridFS » Store files of any size without complicating your stack.
                          •   Commercial Support »Commercial support, training, and consulting available.




                                                                                                             schemas for mongo : http://www.kurl.ws/wJ


Wednesday, 21 July 2010
Supported Drivers




                           mongodb.org Supported
                            •   C
                            •   C++
                            •   Java
                            •   Javascript
                            •   Perl
                            •   PHP
                            •   Python
                            •   Ruby
                           Community Supported
                                                   •   Lua
                            •   REST
                                                   •   node.js
                            •   C# and .NET
                                                   •   Objective C
                            •   Clojure
                                                   •   PHP
                            •   ColdFusion
                                                   •   PowerShell
                            •   Delphi
                                                   •   Python
                            •   Erlang
                                                   •   Ruby
                            •   Factor
                                                   •   Scala
                            •   Fantom
                                                   •   Scheme (PLT)
                            •   F#
                                                   •   Smalltalk
                            •   Go
                            •   Groovy
                            •   Haskell
                            •   Javascript




                                                                      more info: www.mongodb.org


Wednesday, 21 July 2010
Install on ubuntu




                                            EDIT YOUR SOURCES FILE
                                             nano /etc/apt/sources.list

                                            ADD THE FOLLOWING LINE
                             deb http://downloads.mongodb.org/distros/ubuntu 9.4 10gen

                                                NOW UPDATE APT
                                                   apt-get update
                                           apt-get install mongodb-stable

                                              apt-get install php5-dev

                                           INSTALL THE PHP DRIVER
                                               pecl install mongo




                                                                                    All Instructions http://kurl.ws/wH


Wednesday, 21 July 2010
Install on ubuntu   view db stats : http://localhost:28017/




Wednesday, 21 July 2010
Durability




                          Durability - You had to ask
                                Long long story




Wednesday, 21 July 2010
Examples - from the console




Wednesday, 21 July 2010
Examples - from the console




             > db.accounts.count() 1
             > db.accounts.find().forEach(function(doc){
                   print(tojson(doc));
             });




Wednesday, 21 July 2010
Examples - from the console


        > use testing
          switched to db testing
        > db.colors.insert({name:'red', primary:true})
        > db.colors.insert({name:'green', primary:true})
        > db.colors.insert({name:'blue', primary:true})
        > db.colors.insert({name:'purple', primary:false})
        > db.colors.insert({name:'orange', primary:false})
        > db.colors.insert({name:'yellow', primary:false})


        SELECT * from colors WHERE name = 'green' ; because I am sucker.

        > db.colors.find({name:'green'})
        { "_id" : ObjectId("4bed7af40b4acd070c593ba7"), "name" : "green",
        "primary" : true }




Wednesday, 21 July 2010
Examples - from the console




         Skip and Limit
        db.users.find().skip(20).limit(10);

         Limiting Fields, only get ssn
        db.users.find({last_name: 'Smith'}, {'ssn': 1});

         Greater than
        db.collection.find({ "field" : { $gt: value } } );

         Values in Embeded Objects
        db.postings.find( { "author.name" : "joe" } );

         Sort
        db.myCollection.find().sort( { ts : -1 } ); // sort by ts, descending order

         Upsert
        db.people.update( { name:"Joe" }, { $inc: { x:1, y:1 } }, true );




Wednesday, 21 July 2010
Examples - Real PHP




Wednesday, 21 July 2010
Examples - Real PHP




Wednesday, 21 July 2010
OLD




Wednesday, 21 July 2010
OLD




Wednesday, 21 July 2010
Mongo Hub GUI




Wednesday, 21 July 2010
backup




                          -fsync (mongo command)
                          - shutdown copy /data/db
                                - mongodump




Wednesday, 21 July 2010
or




                          Facebook still uses MySQL, a lot. Wikipedia uses MySQL, a
                          lot. FriendFeed uses MySQL, a lot. NoSQL is a great tool, but
                          it’s certainly not going to be your competitive edge, it’s not
                          going to make your app hot, and most of all, your users won’t
                          give a shit about any of this.
                          What am I going to build my next app on? Probably Postgres.
                          Will I use NoSQL? Maybe. I might also use Hadoop and Hive.
                          I might keep everything in flat files. Maybe I’ll start hacking on
                          Maglev. I’ll use whatever is best for the job. If I need reporting,
                          I won’t be using any NoSQL. If I need caching, I’ll probably use
                          Tokyo Tyrant. If I need ACIDity, I won’t use NoSQL. If I need
                          a ton of counters, I’ll use Redis. If I need transactions, I’ll use
                          Postgres. If I have a ton of a single type of documents, I’ll
                          probably use Mongo. If I need to write 1 billion objects a day,
                          I’d probably use Voldemort. If I need full text search, I’d
                          probably use Solr. If I need full text search of volatile data, I’d
                          probably use Sphinx.



Wednesday, 21 July 2010

More Related Content

What's hot (12)

PDF
Generator Tricks for Systems Programmers, v2.0
David Beazley (Dabeaz LLC)
 
PDF
Riak and Ruby
gschofield
 
PDF
Generator Tricks for Systems Programmers
David Beazley (Dabeaz LLC)
 
PDF
An Introduction to Python Concurrency
David Beazley (Dabeaz LLC)
 
PDF
Mastering Python 3 I/O (Version 2)
David Beazley (Dabeaz LLC)
 
PDF
Node.js Interactive
David Dias
 
PDF
RDM#2- The Distributed Web
David Dias
 
PDF
Groovy, to Infinity and Beyond - Groovy/Grails eXchange 2009
Guillaume Laforge
 
PPTX
Sphinx autodoc - automated api documentation - PyCon.KR 2015
Takayuki Shimizukawa
 
PDF
Mysql
Chris Henry
 
PDF
Základy GWT
Tomáš Holas
 
KEY
Groovy overview, DSLs and ecosystem - Mars JUG - 2010
Guillaume Laforge
 
Generator Tricks for Systems Programmers, v2.0
David Beazley (Dabeaz LLC)
 
Riak and Ruby
gschofield
 
Generator Tricks for Systems Programmers
David Beazley (Dabeaz LLC)
 
An Introduction to Python Concurrency
David Beazley (Dabeaz LLC)
 
Mastering Python 3 I/O (Version 2)
David Beazley (Dabeaz LLC)
 
Node.js Interactive
David Dias
 
RDM#2- The Distributed Web
David Dias
 
Groovy, to Infinity and Beyond - Groovy/Grails eXchange 2009
Guillaume Laforge
 
Sphinx autodoc - automated api documentation - PyCon.KR 2015
Takayuki Shimizukawa
 
Základy GWT
Tomáš Holas
 
Groovy overview, DSLs and ecosystem - Mars JUG - 2010
Guillaume Laforge
 

Viewers also liked (13)

PDF
Empowerment day Lisbon
Conrad Llorens
 
PPT
CRS Project
fawcettbj
 
PDF
Manual pi cs log
ferdelvasto
 
PPT
ADHD
nolankr
 
PPTX
Pepita story map
ashraf_sharkawi
 
PDF
IAのサイト構造とFatWireのツリー構造
FatWireKK
 
PPT
Orcutt Fasano Wealth Management Philosophy
MarkFasano
 
PPT
บทที่ 4 ระบบเครือข่าย network
Beauso English
 
PDF
Cyber 2009
João Grilo
 
PDF
3pg36x28 fv
JMCproducts
 
PPT
Charge conference 2013
Pete Berntson
 
Empowerment day Lisbon
Conrad Llorens
 
CRS Project
fawcettbj
 
Manual pi cs log
ferdelvasto
 
ADHD
nolankr
 
Pepita story map
ashraf_sharkawi
 
IAのサイト構造とFatWireのツリー構造
FatWireKK
 
Orcutt Fasano Wealth Management Philosophy
MarkFasano
 
บทที่ 4 ระบบเครือข่าย network
Beauso English
 
Cyber 2009
João Grilo
 
3pg36x28 fv
JMCproducts
 
Charge conference 2013
Pete Berntson
 
Ad

Similar to Bar Camp Auckland - Mongo DB Presentation BCA4 (20)

PPTX
Realtime Analytics with MongoDB Counters (mongonyc 2012)
Scott Hernandez
 
PDF
Open source Technology
Amardeep Vishwakarma
 
PDF
MongoDB: a gentle, friendly overview
Antonio Pintus
 
PDF
Using Spring with NoSQL databases (SpringOne China 2012)
Chris Richardson
 
PDF
Using NoSQL with Yo' SQL
Rich Thornett
 
PDF
Proud to be polyglot
Tugdual Grall
 
PPTX
Drop acid
Mike Feltman
 
PDF
Mongo db transcript
foliba
 
PDF
Symfony2 and MongoDB
Pablo Godel
 
KEY
Mongo NYC PHP Development
Fitz Agard
 
PDF
MongoDB at FrozenRails
Mike Dirolf
 
PDF
SQL? NoSQL? NewSQL?!? What's a Java developer to do? - PhillyETE 2012
Chris Richardson
 
PDF
Introduction to MongoDB
Mike Dirolf
 
PDF
Introduction to MongoDB and Ruby
MongoDB
 
PPTX
No sql solutions - 공개용
Byeongweon Moon
 
PDF
Everyday - mongodb
elliando dias
 
PPTX
MongoDB
Rony Gregory
 
KEY
MongoDB at RuPy
Mike Dirolf
 
KEY
Nosql redis-mongo
ibelmonte
 
PDF
Mongodb (1)
Deepak Kumar
 
Realtime Analytics with MongoDB Counters (mongonyc 2012)
Scott Hernandez
 
Open source Technology
Amardeep Vishwakarma
 
MongoDB: a gentle, friendly overview
Antonio Pintus
 
Using Spring with NoSQL databases (SpringOne China 2012)
Chris Richardson
 
Using NoSQL with Yo' SQL
Rich Thornett
 
Proud to be polyglot
Tugdual Grall
 
Drop acid
Mike Feltman
 
Mongo db transcript
foliba
 
Symfony2 and MongoDB
Pablo Godel
 
Mongo NYC PHP Development
Fitz Agard
 
MongoDB at FrozenRails
Mike Dirolf
 
SQL? NoSQL? NewSQL?!? What's a Java developer to do? - PhillyETE 2012
Chris Richardson
 
Introduction to MongoDB
Mike Dirolf
 
Introduction to MongoDB and Ruby
MongoDB
 
No sql solutions - 공개용
Byeongweon Moon
 
Everyday - mongodb
elliando dias
 
MongoDB
Rony Gregory
 
MongoDB at RuPy
Mike Dirolf
 
Nosql redis-mongo
ibelmonte
 
Mongodb (1)
Deepak Kumar
 
Ad

Recently uploaded (20)

PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 

Bar Camp Auckland - Mongo DB Presentation BCA4

  • 1. SELECT wages FROM companies WHERE coders = “sucker” NO, NO SQL Wednesday, 21 July 2010
  • 3. Lots of pretty pictures to fool you. Wednesday, 21 July 2010
  • 4. Its a change Its Not Relational - Get Over It. It is a rich document store. schemas for mongo : http://www.kurl.ws/wJ Wednesday, 21 July 2010
  • 5. What MongoDB bridges the gap between key-value stores (which are fast and highly scalable) and traditional RDBMS systems (which provide rich queries and deep functionality). MongoDB (from "humongous") is a scalable, high-performance, open source, document-oriented database. Written in C++, MongoDB features: • Document-oriented storage » JSON-style documents with dynamic schemas offer simplicity and power. • Full Index Support » Index on any attribute, just like you're used to. • Replication & High Availability »Mirror across LANs and WANs for scale and peace of mind. • Auto-Sharding » Scale horizontally without compromising functionality. • Querying » Rich, document-based queries. • Fast In-Place Updates »Atomic modifiers for contention-free performance. • Map/Reduce » Flexible aggregation and data processing. • GridFS » Store files of any size without complicating your stack. • Commercial Support »Commercial support, training, and consulting available. schemas for mongo : http://www.kurl.ws/wJ Wednesday, 21 July 2010
  • 6. Supported Drivers mongodb.org Supported • C • C++ • Java • Javascript • Perl • PHP • Python • Ruby Community Supported • Lua • REST • node.js • C# and .NET • Objective C • Clojure • PHP • ColdFusion • PowerShell • Delphi • Python • Erlang • Ruby • Factor • Scala • Fantom • Scheme (PLT) • F# • Smalltalk • Go • Groovy • Haskell • Javascript more info: www.mongodb.org Wednesday, 21 July 2010
  • 7. Install on ubuntu EDIT YOUR SOURCES FILE nano /etc/apt/sources.list ADD THE FOLLOWING LINE deb http://downloads.mongodb.org/distros/ubuntu 9.4 10gen NOW UPDATE APT apt-get update apt-get install mongodb-stable apt-get install php5-dev INSTALL THE PHP DRIVER pecl install mongo All Instructions http://kurl.ws/wH Wednesday, 21 July 2010
  • 8. Install on ubuntu view db stats : http://localhost:28017/ Wednesday, 21 July 2010
  • 9. Durability Durability - You had to ask Long long story Wednesday, 21 July 2010
  • 10. Examples - from the console Wednesday, 21 July 2010
  • 11. Examples - from the console > db.accounts.count() 1 > db.accounts.find().forEach(function(doc){ print(tojson(doc)); }); Wednesday, 21 July 2010
  • 12. Examples - from the console > use testing switched to db testing > db.colors.insert({name:'red', primary:true}) > db.colors.insert({name:'green', primary:true}) > db.colors.insert({name:'blue', primary:true}) > db.colors.insert({name:'purple', primary:false}) > db.colors.insert({name:'orange', primary:false}) > db.colors.insert({name:'yellow', primary:false}) SELECT * from colors WHERE name = 'green' ; because I am sucker. > db.colors.find({name:'green'}) { "_id" : ObjectId("4bed7af40b4acd070c593ba7"), "name" : "green", "primary" : true } Wednesday, 21 July 2010
  • 13. Examples - from the console Skip and Limit db.users.find().skip(20).limit(10); Limiting Fields, only get ssn db.users.find({last_name: 'Smith'}, {'ssn': 1}); Greater than db.collection.find({ "field" : { $gt: value } } ); Values in Embeded Objects db.postings.find( { "author.name" : "joe" } ); Sort db.myCollection.find().sort( { ts : -1 } ); // sort by ts, descending order Upsert db.people.update( { name:"Joe" }, { $inc: { x:1, y:1 } }, true ); Wednesday, 21 July 2010
  • 14. Examples - Real PHP Wednesday, 21 July 2010
  • 15. Examples - Real PHP Wednesday, 21 July 2010
  • 18. Mongo Hub GUI Wednesday, 21 July 2010
  • 19. backup -fsync (mongo command) - shutdown copy /data/db - mongodump Wednesday, 21 July 2010
  • 20. or Facebook still uses MySQL, a lot. Wikipedia uses MySQL, a lot. FriendFeed uses MySQL, a lot. NoSQL is a great tool, but it’s certainly not going to be your competitive edge, it’s not going to make your app hot, and most of all, your users won’t give a shit about any of this. What am I going to build my next app on? Probably Postgres. Will I use NoSQL? Maybe. I might also use Hadoop and Hive. I might keep everything in flat files. Maybe I’ll start hacking on Maglev. I’ll use whatever is best for the job. If I need reporting, I won’t be using any NoSQL. If I need caching, I’ll probably use Tokyo Tyrant. If I need ACIDity, I won’t use NoSQL. If I need a ton of counters, I’ll use Redis. If I need transactions, I’ll use Postgres. If I have a ton of a single type of documents, I’ll probably use Mongo. If I need to write 1 billion objects a day, I’d probably use Voldemort. If I need full text search, I’d probably use Solr. If I need full text search of volatile data, I’d probably use Sphinx. Wednesday, 21 July 2010