Your SlideShare is downloading. ×
0
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Mongodb - drupal dev days
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Mongodb - drupal dev days

3,309

Published on

Introduction to NoSql principles and MongoDB.

Introduction to NoSql principles and MongoDB.

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

No Downloads
Views
Total Views
3,309
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
44
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Who has heard about nosql?Knows?Opinions?Against SQL? Hell no
  • Nothing NewBut wth is happening since 2000 (1st real end of the world, next is in 2038)?
  • Who cares about what is in that cloud?
  • Up to 40 indexes
  • No Op(yet)
  • Noop yet
  • Noop yet
  • Transcript

    • 1. Pierre Joye<br />PHP Core Developer<br />Microsoft - Open Source Tech Center<br />@pierrejoye<br />
    • 2. NoSQL?<br />/(no)?SQL/<br />
    • 3. Original diagram by Simon Munro (@simonmunron)<br />
    • 4. Non Sql Databases<br />Key-value cache<br />Memcached, velocity, apc, wincache<br />Key-value store<br />Keyspace, Azure table<br />eventually-consistentkey-value store<br />Voldemort, SimpleDB<br />document store<br />MongoDB, CouchDB, Riak<br />wide columnar store<br />BigTable, Hbase, Cassandra, Qbase, Hypertable<br />Graph database<br />Neo4j<br />
    • 5. A NEW WAY<br />
    • 6. Know your environment<br />
    • 7. DBs<br />SQL<br />Soap<br />Apps<br />Apps<br />IO<br />Key/val<br />Cache<br />Files<br />
    • 8. Data Cloud<br />Apps<br />Objects<br />
    • 9. RDBMs<br />Apps<br />Objects<br />NoSql<br />
    • 10. Scalable, High-Performance, Open Source, Document-Oriented Database(and schema-free)<br />
    • 11. and me<br />Production Deployments<br />More at http://www.mongodb.org/display/DOCS/Production+Deployments<br />
    • 12. Support and Resources<br />http://www.mongodb.org<br />IRC Freenode #mongodb<br />http://groups.google.com/group/mongodb-user<br />@mongodb<br />
    • 13.
    • 14. Database<br />
    • 15. Collection<br />
    • 16. Documents<br />http://www.flickr.com/photos/critter_lm/199190303/<br />
    • 17. Index<br />
    • 18. <ul><li>Performance
    • 19. Secondary Index
    • 20. Replication/ failover
    • 21. Map Reduce
    • 22. Auto Sharding
    • 23. GIS
    • 24. Cross Platforms and Portable
    • 25. Schema Free</li></li></ul><li>Types<br />JSON Types<br />Null<br />Boolean<br />Integer<br />Long<br />Double<br />String<br />Array<br />Object<br />BSON Types<br />Object id<br />Date<br />Binary data<br />Regular expression<br />Code<br />Max value<br />Min value<br />+<br />
    • 26. Demos<br />
    • 27. Setup<br />
    • 28. Representations<br />
    • 29. Connect to MongoDB<br />$connection = new Mongo( “localhost:9000" ); <br />
    • 30. Create a database<br />$c = new Mongo( “localhost:9000" ); <br />$db = $c->db2;<br />
    • 31. Create a database<br />$c = new Mongo( “localhost:9000" ); <br />$db = $c->db1;<br />
    • 32. Get a Collection<br />$conn = new Mongo( "localhost:9000" );<br />$db = $conn->db1;<br />$collection = $db->user;<br />Or<br />$collection = $conn->db1->user;<br />
    • 33. Create a Document<br />$conn = new Mongo( "localhost:9000" );<br />$c = $conn->db1->user;<br />$user = array(<br /> 'name' => 'John',<br /> 'age' => 32);<br />$c->save($user);<br />
    • 34. Query a Document<br />$conn = new Mongo( "localhost:9000" );<br />$c = $conn->db1->user;<br />$obj = $c->findOne();<br />echo "Created on: " . date(DATE_RFC822, <br /> $obj['_id']->getTimeStamp()) . " ";<br />
    • 35. Update a Document<br /><?php<br />$conn = new Mongo( "localhost:9000" );<br />$c = $conn->db1->user;<br />$c->update(<br />array('name' => 'John'), <br />array('name' => '',<br /> 'age' => 34, <br /> 'city' => 'Munich')<br />);<br />
    • 36. Find doc w/o a field<br /><?php<br />$conn = new Mongo( "localhost:9000" );<br />$c = $conn->db1->user;<br />$cursor = $c->find(array('city' => <br /> array('$exists' => 0)<br /> )<br /> );<br />echo "Found: " . $cursor->count() . " ";<br />
    • 37. Create Index<br /><?php<br />$conn = new Mongo( "localhost:9000" );<br />$c = $conn->db1->user;<br />$c->ensureIndex(array('age' => 1));<br />$cursor = $c->find(array('age' =><br />array( '$gt' => 34, '$lt' => 53 )));<br />

    ×