MongoDB San Francisco DrupalCon 2010
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

MongoDB San Francisco DrupalCon 2010

on

  • 1,829 views

MongoDB San Francisco DrupalCon 2010

MongoDB San Francisco DrupalCon 2010

Statistics

Views

Total Views
1,829
Views on SlideShare
1,817
Embed Views
12

Actions

Likes
2
Downloads
40
Comments
0

1 Embed 12

http://www.slideshare.net 12

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

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 San Francisco DrupalCon 2010 Presentation Transcript

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