Your SlideShare is downloading. ×
0
Document-Oriented Database<br />John Sercel<br />
Document vs. Relational<br />Relational database<br />Tables -&gt; Records<br />Defined schema<br />Document-oriented data...
MongoDB<br /><ul><li>Language drivers</li></ul>C, C++, Java, Javascript, Perl, PHP, Python, Ruby, etc.<br />OS Support<br ...
Installation: Windows, Linux<br /><ul><li>Quick, easy installation</li></ul>Download<br />Unzip the archive file<br />Crea...
MongoDB Basics<br /><ul><li>Basic commands</li></ul>List databases:	show dbs<br />Select database:	use [db name]<br />Inse...
MongoDB Basics<br /><ul><li>Select documents (MongoDB)</li></ul>db.myCollection.find()<br />db.myCollection.find({‘name’ :...
Connecting MongoDB: PHP<br /><ul><li>Install MongoDB PHP Extension</li></ul>Source, PHP Extension Community Library (PECL)...
Connecting MongoDB: PHP<br /><ul><li>PHP Example</li></ul>Insert new document<br />			$connection = new Mongo();<br />			$...
Why Document-Oriented?<br /><ul><li>Storing unique documents</li></ul>Non-standard field set in each entity<br />Speed vs....
References<br />MongoDB. (2009a). Mongodb-10gen confluence website. Retrieved February 5, 2010 from http://www.mongodb.org...
Upcoming SlideShare
Loading in...5
×

MongoDB

2,933

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,933
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
69
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "MongoDB"

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

    Clipping is a handy way to collect important slides you want to go back to later.

×