Your SlideShare is downloading. ×
0
Karoly Negyesi Developer team lead NowPublic.com / Examiner.com
History <ul><li>Ingres early 1970s
Oracle 1979
MySQL 1982
PostGRES 1986 </li></ul>
Moore's law <ul><li>Doubling every 18 months
Applies to: </li><ul><li>Processing speed
Memory capacity
Hard disk capacity </li></ul></ul>
We need drastically different design <ul>http://varnish-cache.org/wiki/ArchitectNotes </ul>
And now some Bayou slides... www.cs.berkeley.edu/~istoica/classes/cs268/06/notes/20-BFTx2.pdf
SQL <ul><li>Rigid schema
Normal forms
Transactions
Rich feature set  http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
“Databases are operating systems that you don't have to write sound drivers for.” - Brian Aker http://twitter.com/timoreil...
Reality <ul><li>The world is not rigid
Denormalization
Too much overhead for transactions
Most of features are rarely needed </li></ul>
Even worse The iPhone
NoSQL <ul><li>Very new
Key-value stores
Upcoming SlideShare
Loading in...5
×

MongoDB San Francisco DrupalCon 2010

1,191

Published on

MongoDB San Francisco DrupalCon 2010

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,191
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
41
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "MongoDB San Francisco DrupalCon 2010"

  1. 1. Karoly Negyesi Developer team lead NowPublic.com / Examiner.com
  2. 2. History <ul><li>Ingres early 1970s
  3. 3. Oracle 1979
  4. 4. MySQL 1982
  5. 5. PostGRES 1986 </li></ul>
  6. 6. Moore's law <ul><li>Doubling every 18 months
  7. 7. Applies to: </li><ul><li>Processing speed
  8. 8. Memory capacity
  9. 9. Hard disk capacity </li></ul></ul>
  10. 10. We need drastically different design <ul>http://varnish-cache.org/wiki/ArchitectNotes </ul>
  11. 11. And now some Bayou slides... www.cs.berkeley.edu/~istoica/classes/cs268/06/notes/20-BFTx2.pdf
  12. 12. SQL <ul><li>Rigid schema
  13. 13. Normal forms
  14. 14. Transactions
  15. 15. Rich feature set http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
  16. 16. “Databases are operating systems that you don't have to write sound drivers for.” - Brian Aker http://twitter.com/timoreilly/status/12247022198 </li></ul>
  17. 17. Reality <ul><li>The world is not rigid
  18. 18. Denormalization
  19. 19. Too much overhead for transactions
  20. 20. Most of features are rarely needed </li></ul>
  21. 21. Even worse The iPhone
  22. 22. NoSQL <ul><li>Very new
  23. 23. Key-value stores
  24. 24. Document stores
  25. 25. Performant
  26. 26. Scalable
  27. 27. Not too many features </li></ul>
  28. 28. MongoDB <ul><li>Databases
  29. 29. Collections
  30. 30. Documents
  31. 31. Strictly but dynamically typed
  32. 32. Arrays and objects
  33. 33. In place updates
  34. 34. Foreign key support
  35. 35. Native PHP driver </li></ul>
  36. 36. Simple example <ul><li>db.things.save({ x : 3 })
  37. 37. db.things.save({ y : 4 })
  38. 38. db.things.find()
  39. 39. { &quot;_id&quot; : ObjectId(&quot;4b10d1997bd1e19a46fc8862&quot;), &quot;x&quot; : 3 }
  40. 40. { &quot;_id&quot; : ObjectId(&quot;4b10d1aa7bd1e19a46fc8863&quot;), &quot;y&quot; : 4 } </li></ul>
  41. 41. ObjectID <ul><li>By default generated
  42. 42. Can be anything as long it's unique </li></ul>
  43. 43. Update <ul><li>db.things.save({a:1,b:2,c:3})
  44. 44. o=db.things.findOne({b:2})
  45. 45. o.c=4
  46. 46. db.things.update({b:2}, o)
  47. 47. db.things.find()
  48. 48. { &quot;a&quot; : 1, &quot;b&quot; : 2, &quot;c&quot; : 4 } </li></ul>
  49. 49. Modifier operators <ul><li>db.things.update({ b : 2} , { $set : { c : 4 }})
  50. 50. db.things.find()
  51. 51. {&quot;a&quot; : 1, &quot;b&quot; : 2, &quot;c&quot; : 4 }
  52. 52. db.things.update({ b : 2} , { $inc : { c : 100 }})
  53. 53. db.things.find() {&quot;a&quot; : 1, &quot;b&quot; : 2, &quot;c&quot; : 104 } </li></ul>
  54. 54. Arrays <ul><li>db.things.save({a:[1,2,3]})
  55. 55. db.things.save({a:[5,6,7]})
  56. 56. db.things.find({a:2}) { &quot;a&quot; : [ 1, 2, 3 ] } </li></ul>
  57. 57. Array modification <ul><li>db.things.insert({n:1,a:[1,2,3]})
  58. 58. db.things.update({n:1},{$push:{a:4}})
  59. 59. db.things.find()
  60. 60. { &quot;n&quot; : 1, &quot;a&quot; : [ 1, 2, 3, 4 ] } </li></ul>
  61. 61. Objects <ul><li>db.things.save({db:{name:'mongodb', interesting:true }})
  62. 62. db.things.save({db:{name:'mysql', interesting:false }})
  63. 63. db.things.find({'db.interesting':true})
  64. 64. {&quot;db&quot; : { &quot;name&quot; : &quot;mongodb&quot;, &quot;interesting&quot; : true } } </li></ul>
  65. 65. Indexes <ul><li>Anything can be indexed
  66. 66. Objects
  67. 67. Arrays </li></ul>
  68. 68. New design <ul><li>Not much design is needed...
  69. 69. Search for ids and then load the rest </li></ul>
  70. 70. What are great fits <ul><li>Statistics </li><ul><li>Many writes
  71. 71. Loss is not that big a deal </li></ul><li>Fluid data </li><ul><li>Products in a web store
  72. 72. User profiles </li></ul></ul>
  73. 73. Not so good fit <ul><li>Very complex queries
  74. 74. Transaction needs </li></ul>
  75. 75. Drupal and Mongo <ul><li>Cache
  76. 76. Field_storage. Oh yes!
  77. 77. Session
  78. 78. Watchdog
  79. 79. Block
  80. 80. Queue </li></ul>
  81. 81. Crazy... <ul><li>DBTNG driver </li></ul>
  1. A particular slide catching your eye?

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

×