• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
MongoDB
 

MongoDB

on

  • 3,638 views

 

Statistics

Views

Total Views
3,638
Views on SlideShare
3,636
Embed Views
2

Actions

Likes
2
Downloads
67
Comments
0

1 Embed 2

http://www.slideshare.net 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    MongoDB MongoDB Presentation Transcript

    • Document-Oriented Database
      John Sercel
    • Document vs. Relational
      Relational database
      Tables -> Records
      Defined schema
      Document-oriented database
      Collections -> Documents
      No schema
      John Sercel | 2
    • MongoDB
      • Language drivers
      C, C++, Java, Javascript, Perl, PHP, Python, Ruby, etc.
      OS Support
      OS X, Linux, Windows, Solaris
      Open Source, Free
      Support
      Community
      Commercial
      John Sercel | 3
    • Installation: Windows, Linux
      • Quick, easy installation
      Download
      Unzip the archive file
      Create a data directory: /data/db (c:datadb)
      Start MongoDB Server
      ./bin/mongod[binmongod.exe]
      Start MongoDB Client
      ./bin/mongo [binmongo.exe]
      John Sercel | 4
    • MongoDB Basics
      • Basic commands
      List databases: show dbs
      Select database: use [db name]
      Insert document
      db.myCollection.insert({‘myKey’ : ‘myValue’, ‘anotherKey’ : ‘anotherValue’ })
      John Sercel | 5
    • MongoDB Basics
      • Select documents (MongoDB)
      db.myCollection.find()
      db.myCollection.find({‘name’ : ‘John Doe’})
      • Select documents (SQL)
      SELECT * FROM myTable
      SELECT * FROM myTable WHERE name = ‘John Doe’
      John Sercel | 6
    • Connecting MongoDB: PHP
      • Install MongoDB PHP Extension
      Source, PHP Extension Community Library (PECL)
      Update configuration file
      Restart server software
      John Sercel | 7
    • Connecting MongoDB: PHP
      • PHP Example
      Insert new document
      $connection = new Mongo();
      $collection = $connection->databaseName->collectionName;
      $document = array( "name" => “John Doe”);
      $collection->insert($document);
      Select document(s)
      $documents = $collection->find();
      John Sercel | 8
    • Why Document-Oriented?
      • Storing unique documents
      Non-standard field set in each entity
      Speed vs. Normalization
      Normalization decreases redundancy, and speed.
      Relational operations are expensive
      Simple data storage preferable for heavy use
      BigTable, Cassandra
      John Sercel | 9
    • References
      MongoDB. (2009a). Mongodb-10gen confluence website. Retrieved February 5, 2010 from http://www.mongodb.org/
      MongoDB. (2009b). Quickstart-mongodb. Retrieved February 8, 2010 from http://www.mongodb.org/display/DOCS/Quickstart /
      MongoDB. (2009c). Developer zone-mongodb. Retrieved February 8, 2010 from http://www.mongodb.org/display/DOCS/Developer+Zone/
      The PHP Group. (2009). Php manual-mongo. Retrieved February 5, 2010 from http://us3.php.net/manual/en/mongo.manual.php
      John Sercel | 10