0
Pierre Joye<br />PHP Core Developer<br />Microsoft - Open Source Tech Center<br />@pierrejoye<br />
NoSQL?<br />/(no)?SQL/<br />
Original diagram by Simon Munro (@simonmunron)<br />
Non Sql Databases<br />Key-value cache<br />Memcached, velocity, apc, wincache<br />Key-value store<br />Keyspace, Azure t...
A NEW WAY<br />
Know your environment<br />
DBs<br />SQL<br />Soap<br />Apps<br />Apps<br />IO<br />Key/val<br />Cache<br />Files<br />
Data Cloud<br />Apps<br />Objects<br />
RDBMs<br />Apps<br />Objects<br />NoSql<br />
Scalable, High-Performance, Open Source, Document-Oriented Database(and schema-free)<br />
and me<br />Production Deployments<br />More at http://www.mongodb.org/display/DOCS/Production+Deployments<br />
Support and Resources<br />http://www.mongodb.org<br />IRC Freenode #mongodb<br />http://groups.google.com/group/mongodb-u...
Database<br />
Collection<br />
Documents<br />http://www.flickr.com/photos/critter_lm/199190303/<br />
Index<br />
<ul><li>Performance
Secondary Index
Replication/ failover
Map Reduce
Auto Sharding
GIS
Cross Platforms and Portable
Schema Free</li></li></ul><li>Types<br />JSON Types<br />Null<br />Boolean<br />Integer<br />Long<br />Double<br />String<...
Demos<br />
Setup<br />
Representations<br />
Connect to MongoDB<br />$connection = new Mongo( “localhost:9000" ); <br />
Create a database<br />$c = new Mongo( “localhost:9000" ); <br />$db = $c->db2;<br />
Create a database<br />$c = new Mongo( “localhost:9000" ); <br />$db = $c->db1;<br />
Upcoming SlideShare
Loading in...5
×

Mongodb - drupal dev days

3,327

Published on

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,327
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
45
Comments
0
Likes
2
Embeds 0
No embeds

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 of "Mongodb - drupal dev days"

    1. 1. Pierre Joye<br />PHP Core Developer<br />Microsoft - Open Source Tech Center<br />@pierrejoye<br />
    2. 2. NoSQL?<br />/(no)?SQL/<br />
    3. 3. Original diagram by Simon Munro (@simonmunron)<br />
    4. 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. 5. A NEW WAY<br />
    6. 6. Know your environment<br />
    7. 7. DBs<br />SQL<br />Soap<br />Apps<br />Apps<br />IO<br />Key/val<br />Cache<br />Files<br />
    8. 8. Data Cloud<br />Apps<br />Objects<br />
    9. 9. RDBMs<br />Apps<br />Objects<br />NoSql<br />
    10. 10. Scalable, High-Performance, Open Source, Document-Oriented Database(and schema-free)<br />
    11. 11. and me<br />Production Deployments<br />More at http://www.mongodb.org/display/DOCS/Production+Deployments<br />
    12. 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. 13.
    14. 14. Database<br />
    15. 15. Collection<br />
    16. 16. Documents<br />http://www.flickr.com/photos/critter_lm/199190303/<br />
    17. 17. Index<br />
    18. 18. <ul><li>Performance
    19. 19. Secondary Index
    20. 20. Replication/ failover
    21. 21. Map Reduce
    22. 22. Auto Sharding
    23. 23. GIS
    24. 24. Cross Platforms and Portable
    25. 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. 26. Demos<br />
    27. 27. Setup<br />
    28. 28. Representations<br />
    29. 29. Connect to MongoDB<br />$connection = new Mongo( “localhost:9000" ); <br />
    30. 30. Create a database<br />$c = new Mongo( “localhost:9000" ); <br />$db = $c->db2;<br />
    31. 31. Create a database<br />$c = new Mongo( “localhost:9000" ); <br />$db = $c->db1;<br />
    32. 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. 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. 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. 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. 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. 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 />
    1. A particular slide catching your eye?

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

    ×