NoSQL: Death to Relational Databases(?)

  • 6,500 views
Uploaded on

Overview of the NoSQL ecosystem given at RubyConf 2009

Overview of the NoSQL ecosystem given at RubyConf 2009

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
6,500
On Slideshare
0
From Embeds
0
Number of Embeds
4

Actions

Shares
Downloads
358
Comments
1
Likes
25

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

Transcript

  • 1. NoSQL Death  to  Relational  Databases(?) bensco'ield  –  viget  labs rubyconf 20  november  2009 Friday, November 20, 2009
  • 2. Motivations Friday, November 20, 2009
  • 3. Performance Friday, November 20, 2009
  • 4. Friday, November 20, 2009
  • 5. Scalability Friday, November 20, 2009
  • 6. Friday, November 20, 2009
  • 7. Friday, November 20, 2009
  • 8. Flexibility Friday, November 20, 2009
  • 9. Friday, November 20, 2009
  • 10. Locus  of  Work Friday, November 20, 2009
  • 11. Charlie  Chaplin Jet  Li Hank  Mann Marian  Collier Friday, November 20, 2009
  • 12. Domain  Complexity Friday, November 20, 2009
  • 13. Friday, November 20, 2009
  • 14. Taxonomy Friday, November 20, 2009
  • 15. Key-­‐Value  Stores Friday, November 20, 2009
  • 16. distributed  hash  tables Friday, November 20, 2009
  • 17. Dynamo GT.M PStore Redis Friday, November 20, 2009
  • 18. Column-­‐Oriented  Stores Friday, November 20, 2009
  • 19. semi-­‐structured Friday, November 20, 2009
  • 20. BigTable Cassandra HBase Friday, November 20, 2009
  • 21. Document-­‐Oriented  Stores Friday, November 20, 2009
  • 22. also  semi-­‐structured Friday, November 20, 2009
  • 23. CouchDB MongoDB RDDB Riak Friday, November 20, 2009
  • 24. Graph  Databases Friday, November 20, 2009
  • 25. graph  theory Friday, November 20, 2009
  • 26. ActiveRDF   AllegroGraph Neo4J Friday, November 20, 2009
  • 27. Comparisons Friday, November 20, 2009
  • 28. Performance Friday, November 20, 2009
  • 29. key-­‐value  stores column-­‐oriented  stores document-­‐oriented  stores relational  databases graph  databases Friday, November 20, 2009
  • 30. Scalability Friday, November 20, 2009
  • 31. key-­‐value  stores column-­‐oriented  stores document-­‐oriented  stores relational  databases graph  databases Friday, November 20, 2009
  • 32. Flexibility Friday, November 20, 2009
  • 33. key-­‐value  stores document-­‐oriented  stores graph  databases   column-­‐oriented  stores relational  databases Friday, November 20, 2009
  • 34. Locus  of  Work Friday, November 20, 2009
  • 35. key-­‐value  stores column-­‐oriented  stores document-­‐oriented  stores relational  databases graph  databases   Friday, November 20, 2009
  • 36. Domain  Complexity Friday, November 20, 2009
  • 37. key-­‐value  stores column-­‐oriented  stores document-­‐oriented  stores relational  databases graph  databases   Friday, November 20, 2009
  • 38. Examples Friday, November 20, 2009
  • 39. Redis Friday, November 20, 2009
  • 40. Data  Types strings lists sets Friday, November 20, 2009
  • 41. In-­‐Memory periodic  snapshots master-­‐slave  replication memory-­‐bound Friday, November 20, 2009
  • 42. require 'redis' gl = Redis.new # A string gl['name'] = 'Kyle Rayner' gl['name'] gl.delete('name') # A list gl.push_tail 'to-dos', 'Lose Ion power' gl.push_tail 'to-dos', 'Mourn dead loved ones' gl.push_tail 'to-dos', 'Blow up zombie lanterns' gl.list_range('to-dos', 0, -1) Friday, November 20, 2009
  • 43. Tokyo  Cabinet Friday, November 20, 2009
  • 44. Data  Types strings tables! Friday, November 20, 2009
  • 45. Related  Projects tyrant dystopia promenade Friday, November 20, 2009
  • 46. require 'rufus/tokyo' # Key-value leagues = Rufus::Tokyo::Cabinet.new('jl.tch') leagues['JLI'] = [ 'Batman', 'Black Canary', 'Blue Beetle', 'Captain Marvel', 'Doctor Light', 'Doctor Fate', 'Guy Gardner','Martian Manhunter', 'Mister Miracle' ].to_yaml YAML.load(leagues['JLI']) Friday, November 20, 2009
  • 47. require 'rufus/tokyo' # Table big7 = Rufus::Tokyo::Table.new('big7.tct') big7['s'] = {'name' => 'Superman', 'role' => 'deus ex machina'} big7['b'] = {'name' => 'Batman', 'role' => 'mastermind'} big7['gl'] = {'name' => 'Green Lantern', 'role' => 'space cop'} big7['f'] = {'name' => 'Flash', 'role' => 'speedster'} big7['mm'] = {'name' => 'Martian Manhunter', 'role' => '?'} big7['ww'] = {'name' => 'Wonder Woman', 'role' => 'hitter'} big7['a'] = {'name' => 'Aquaman', 'role' => 'fish-talking'} big7.query {|q| q.add_condition 'role', :streq, 'fish-talking' } Friday, November 20, 2009
  • 48. Cassandra Friday, November 20, 2009
  • 49. Genealogy Dynamo BigTable Friday, November 20, 2009
  • 50. Column-­‐Oriented columns supercolumns column  families Friday, November 20, 2009
  • 51. Distributed automatic  replication eventual  consistency easy  expansion Friday, November 20, 2009
  • 52. Availability weak  reads quorum  reads Friday, November 20, 2009
  • 53. require 'cassandra' op = Cassandra.new('OnePiece') op.insert(:People, '1', {'name' => 'Luffy'}) op.insert(:People, '2', {'name' => 'Crocodile'}) op.insert(:People, '3', {'name' => 'Mr. 3'}) op.insert(:Fights, '1', {'opponents' => {UUID.new => '2'}}) op.insert(:Fights, '1', {'opponents' => {UUID.new => '3'}}) luffy_fights = op.get(:Fights, '1', 'opponents') luffy_fights.map {|t, opp| op.get(:People, opp, 'name')} Friday, November 20, 2009
  • 54. CouchDB Friday, November 20, 2009
  • 55. Web-­‐Inspired JSON  storage HTTP  /  RESTful  interface Friday, November 20, 2009
  • 56. Views predeVined,  updated  incrementally javascript  for  map/reduce Friday, November 20, 2009
  • 57. Updates full,  including  embedded  documents Friday, November 20, 2009
  • 58. require 'couchrest' konoha = CouchRest.database!('http://127.0.0.1:5984/konoha') naruto = konoha.save_doc { 'name' => 'Naruto Uzumaki', 'chakra' => 'wind' } shikamaru = konoha.save_doc { 'name' => 'Shikamaru Nara', 'chunin' => true } konoha.save_doc { '_id' => '_design/first', :views => { :chunin => { :map => 'function(doc){if(doc.chunin){emit(null, doc);}}' } } } puts konoha.views('first/chunin')['rows'].inspect Friday, November 20, 2009
  • 59. MongoDB Friday, November 20, 2009
  • 60. Storage binary  JSON  documents Friday, November 20, 2009
  • 61. Access native  clients Friday, November 20, 2009
  • 62. Queries dynamic index-­‐based Friday, November 20, 2009
  • 63. Updates allows  partial  updates Friday, November 20, 2009
  • 64. require 'mongo' avengers = Mongo::Connection.new.db('avengers') members = avengers.collection('members') members.insert {'name' => 'Ant-Man'} members.insert {'name' => 'Hulk'} members.insert {'name' => 'Iron Man'} members.insert {'name' => 'Thor'} members.insert {'name' => 'Wasp'} members.create_index('name') pym = members.find {'name' => 'Ant-Man'} pym['name'] = 'Giant-Man' pym.save members.remove {'name' => 'Hulk'} members.insert {'name' => 'Captain America'} Friday, November 20, 2009
  • 65. Neo4J Friday, November 20, 2009
  • 66. Structure nodes  and  edges key-­‐value  pairs Friday, November 20, 2009
  • 67. Queries lucene Friday, November 20, 2009
  • 68. require 'neo4j' class Person include Neo4j::NodeMixin property :name, :mutant index :name, :mutant has_n :interests has_n :dates has_n :marriages def initialize(name, mutant = true) name = name mutant = mutant end end Friday, November 20, 2009
  • 69. Neo4j::Transaction.run do magneto = Person.new('Magneto') esme = Person.new('Esme') rogue = Person.new('Rogue') magda = Person.new('Magda', false) wasp = Person.new('Wasp', false) magneto.interests << wasp magneto.marriages << magda magneto.dates << rogue esme.interests << magneto magda.marriages << magneto rogue.dates << magneto end Friday, November 20, 2009
  • 70. magneto = Person.find(:name => 'Magneto') # Who likes Magneto? magneto.relationships.incoming(:interests).nodes # Which non-mutants has Magneto dated? magneto.dates{ !mutant? }.to_a Friday, November 20, 2009
  • 71. Simulations Friday, November 20, 2009
  • 72. Structure Friday, November 20, 2009
  • 73. people { ‘name’:‘Jimmy Olsen’ ‘title’:‘Superman’s Pal’ ‘company_id’:12441 } companies { _id:12441 ‘name’:‘Daily Planet’ } Friday, November 20, 2009
  • 74. Lack  of  Structure Friday, November 20, 2009
  • 75. mysql> SELECT * FROM people LIMIT 1 G *************************** 1. row *************************** id: 1 content: --- company: Daily Planet name: Jimmy Olsen title: Superman’s Pal Friday, November 20, 2009
  • 76. mysql> desc people; +-------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+-------+ | id | int(11) | YES | | NULL | | | name | varchar(50) | YES | | NULL | | +-------+-------------+------+-----+---------+-------+ mysql> desc attributes; +-----------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+--------------+------+-----+---------+-------+ | id | int(11) | YES | | NULL | | | person_id | int(11) | YES | | NULL | | | attribute | varchar(50) | YES | | NULL | | | value | varchar(100) | YES | | NULL | | +-----------+--------------+------+-----+---------+-------+ Friday, November 20, 2009
  • 77. Not  Only  SQL Friday, November 20, 2009
  • 78. Caching Friday, November 20, 2009
  • 79. Already  in  Use memcached Friday, November 20, 2009
  • 80. Logging Friday, November 20, 2009
  • 81. Rails  Log  Replacement http://github.com/peburrows/mongo_db_logger Friday, November 20, 2009
  • 82. Hybrid  Domains Friday, November 20, 2009
  • 83. different  domains Friday, November 20, 2009
  • 84. Publishing e-­‐commerce documents Friday, November 20, 2009
  • 85. Dating e-­‐commerce social  graph Friday, November 20, 2009
  • 86. different  scales Friday, November 20, 2009
  • 87. Photo  Sharing user  accounts uploaded  photos Friday, November 20, 2009
  • 88. Next  Steps Friday, November 20, 2009
  • 89. Explore Friday, November 20, 2009
  • 90. Database  List http://internetmindmap.com/database_software NoSQL  Google  Group http://groups.google.com/group/nosql-­‐discussion NoSQL  Ecosystem http://www.rackspacecloud.com/blog/2009/11/09/nosql-­‐ecosystem/ Wave! Friday, November 20, 2009
  • 91. Ignore  the  Database Friday, November 20, 2009
  • 92. Logical  Modeling  First be  mindful Friday, November 20, 2009
  • 93. Change  the  Default Friday, November 20, 2009
  • 94. Application  Templates start  with  something  new Friday, November 20, 2009
  • 95. bensco'ield @bsco'ield ben.sco'ield@viget.com http:/ /spkr8.com/bscoVield http:/ /viget.com/extend http:   /benscoVield.com / Friday, November 20, 2009