WindyCityRails - "Comics" Is Hard

1,590 views
1,512 views

Published on

Domain modeling/alternative database talk given at WindyCityRails 2009

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

No Downloads
Views
Total views
1,590
On SlideShare
0
From Embeds
0
Number of Embeds
86
Actions
Shares
0
Downloads
19
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

WindyCityRails - "Comics" Is Hard

  1. 1. “Comics” Is Hard: On Domains and Databases Ben Scofield – Viget Labs Saturday, September 12, 2009
  2. 2. Modeling flickr: bunchofpants Saturday, September 12, 2009
  3. 3. Biology Saturday, September 12, 2009
  4. 4. Linnean taxonomy Saturday, September 12, 2009
  5. 5. Kingdom Animalia Phylum Chordata Class Mammalia Order Carnivora Family Felidae Genus Panthera Species tigris flickr: pandiyan Saturday, September 12, 2009
  6. 6. Animalia Chordata Mammalia Carnivora Felidae Panthera tigris flickr: pandiyan Saturday, September 12, 2009
  7. 7. kingdom phylum class genus family order species organism Saturday, September 12, 2009
  8. 8. Problem The levels are imaginary Saturday, September 12, 2009
  9. 9. subphylum kingdom phylum class superclass subclass subfamily suborder superorder genus family order subgenus superfamily subspecies species organism variety Saturday, September 12, 2009
  10. 10. subphylum kingdom phylum class ? superclass subclass subfamily suborder superorder genus family order subgenus superfamily subspecies species organism variety Saturday, September 12, 2009
  11. 11. subspecies taxon taxon taxon species organism variety Saturday, September 12, 2009
  12. 12. Species flickr: cpurrin1 Saturday, September 12, 2009
  13. 13. Reproductive Isolation flickr: superciliousness Saturday, September 12, 2009
  14. 14. Reproductive Isolation flickr: superciliousness Saturday, September 12, 2009
  15. 15. Saturday, September 12, 2009
  16. 16. Saturday, September 12, 2009
  17. 17. flickr: chiotsrun Saturday, September 12, 2009
  18. 18. flickr: niznoz Saturday, September 12, 2009
  19. 19. Numerical taxonomy Saturday, September 12, 2009
  20. 20. Cladistics Saturday, September 12, 2009
  21. 21. taxon clade taxon organism Saturday, September 12, 2009
  22. 22. Problem Cladistics is historical and counter-intuitive Saturday, September 12, 2009
  23. 23. flickr: goellnitz Saturday, September 12, 2009
  24. 24. flickr: goellnitz pcoin Saturday, September 12, 2009
  25. 25. Saturday, September 12, 2009
  26. 26. Saturday, September 12, 2009
  27. 27. The Challenge Unclear, imprecise domain Saturday, September 12, 2009
  28. 28. Comics Saturday, September 12, 2009
  29. 29. publisher title issue Saturday, September 12, 2009
  30. 30. Saturday, September 12, 2009
  31. 31. publisher imprint title issue Saturday, September 12, 2009
  32. 32. Saturday, September 12, 2009
  33. 33. publisher imprint title issue volume Saturday, September 12, 2009
  34. 34. Saturday, September 12, 2009
  35. 35. Saturday, September 12, 2009
  36. 36. Saturday, September 12, 2009
  37. 37. publisher imprint title issue volume trade Saturday, September 12, 2009
  38. 38. Saturday, September 12, 2009
  39. 39. Saturday, September 12, 2009
  40. 40. Saturday, September 12, 2009
  41. 41. Saturday, September 12, 2009
  42. 42. Saturday, September 12, 2009
  43. 43. Saturday, September 12, 2009
  44. 44. publisher imprint title issue volume variant trade Saturday, September 12, 2009
  45. 45. Saturday, September 12, 2009
  46. 46. Saturday, September 12, 2009
  47. 47. Saturday, September 12, 2009
  48. 48. Saturday, September 12, 2009
  49. 49. name publisher imprint title issue volume variant trade Saturday, September 12, 2009
  50. 50. Saturday, September 12, 2009
  51. 51. Saturday, September 12, 2009
  52. 52. Saturday, September 12, 2009
  53. 53. Saturday, September 12, 2009
  54. 54. Saturday, September 12, 2009
  55. 55. name publisher imprint title ? issue nested set? volume variant trade Saturday, September 12, 2009
  56. 56. Saturday, September 12, 2009
  57. 57. Saturday, September 12, 2009
  58. 58. imprint ?!?! publisher title name issue storyline volume nested set? variant trade Saturday, September 12, 2009
  59. 59. science fiction noir horror independent Martial Arts genres? historical Pirate superhero Saturday, September 12, 2009
  60. 60. imprint publisher @#&*! title name genre issue volume nested set? storyline variant trade Saturday, September 12, 2009
  61. 61. The Challenge Complete insanity Saturday, September 12, 2009
  62. 62. Alternatives databases unite! #?forben Saturday, September 12, 2009
  63. 63. http://thisisindexed.com/2009/02/just-because-you-can-doesnt-mean-you-should/ Saturday, September 12, 2009
  64. 64. Key-Value Saturday, September 12, 2009
  65. 65. Redis Tokyo Cabinet Project Voldemort Cassandra* Saturday, September 12, 2009
  66. 66. require "rubygems" require "tokyocabinet" include TokyoCabinet bdb = BDB::new # B-Tree database; keys may have multiple values bdb.open("casket.bdb", BDB::OWRITER | BDB::OCREAT) # store records in the database, allowing duplicates bdb.putdup("key1", "value1") bdb.putdup("key1", "value2") bdb.put("key2", "value3") bdb.put("key3", "value4") # retrieve all values p bdb.getlist("key1") # => ["value1", "value2"] # range query, find all matching keys p bdb.range("key1", true, "key3", true) # => ["key1", "key2", "key3"] http://www.igvita.com/2009/02/13/tokyo-cabinet-beyond-key-value-store/ Saturday, September 12, 2009
  67. 67. Biology x Comics x Saturday, September 12, 2009
  68. 68. Configuration ✓ Caching ✓ Translations ✓ Saturday, September 12, 2009
  69. 69. Saturday, September 12, 2009
  70. 70. Document Saturday, September 12, 2009
  71. 71. Saturday, September 12, 2009
  72. 72. { 'name':'Ben Scofield', 'adjective':'awesomesauce' } { 'name':'Magic Pony', 'description':'It is a *lie*!' } Saturday, September 12, 2009
  73. 73. class Question include MongoMapper::Document key :number, Integer, :required => true key :text, String, :required => true many :choices end class Choice include MongoMapper::EmbeddedDocument key :text, String, :required => true end Saturday, September 12, 2009
  74. 74. Saturday, September 12, 2009
  75. 75. Biology ✓ Comics x Saturday, September 12, 2009
  76. 76. { ‘kingdom’:‘Animalia’, ‘phylum’:‘Chordata’, ‘subphylum’:‘Vertebrata’, ‘class’:‘Mammalia’, ‘subclass’:‘Eutheria’, ‘order’:‘Carnivora’, ‘family’:‘Felidae’, ‘subfamily’:‘Panthernae’, ‘genus’:‘Pantera’, ‘species’:‘tigris’, ‘name’:‘Wanda’ } Saturday, September 12, 2009
  77. 77. { ‘kingdom’:‘Animalia’, ‘subkingdom’:‘Eumetazoa’, ‘phylum’:‘Chordata’, ‘subphylum’:‘Vertebrata’, ‘class’:‘Mammalia’, ‘subclass’:‘Theria’, ‘order’:‘Carnivora’, ‘suborder’: ‘Caniformia’, ‘family’:‘Canidae’, ‘subfamily’:‘Caninae’, ‘tribe’:‘Canini’, ‘genus’:‘Canis’, ‘species’:‘lupus’, ‘subspecies’:‘familiaris’, ‘name’:‘Daisy’ } Saturday, September 12, 2009
  78. 78. class Question include MongoMapper::Document key :number, Integer, :required => true key :text, String, :required => true many :choices end class Choice include MongoMapper::EmbeddedDocument key :text, String, :required => true end Saturday, September 12, 2009
  79. 79. Saturday, September 12, 2009
  80. 80. Graph Saturday, September 12, 2009
  81. 81. AllegroGraph Java Java / Lisp Saturday, September 12, 2009
  82. 82. http://neotechnology.com/why-neo Saturday, September 12, 2009
  83. 83. http://markorodriguez.com/Lectures_files/risk-symposium2009.pdf Saturday, September 12, 2009
  84. 84. flickr: 9948354@N08 Saturday, September 12, 2009
  85. 85. Biology ✓ Comics ✓ Saturday, September 12, 2009
  86. 86. Animalia ... Felidae subfamilyof genusof Panthernae genusof Panthera speciesof tigris member 001 age name weight 3 Wanda 300 Saturday, September 12, 2009
  87. 87. Animalia ... Felidae subfamilyof genusof Panthernae genusof Panthera species speciesof type tigris 010 name tigris member 001 age name weight 3 Wanda 300 Saturday, September 12, 2009
  88. 88. Group IV orderof Picornavirales familyof Picornaviridae genusof Rhinovirus speciesof human rhinovirus A member 002 Saturday, September 12, 2009
  89. 89. class Mammalia Group IV group orderof orderof Carnivora Picornavirales familyof familyof Felidae Picornaviridae subfamilyof Panthernae genusof genusof genusof Panthera Rhinovirus speciesof speciesof human tigris rhinovirus A member member 001 002 Saturday, September 12, 2009
  90. 90. DC imprintof titleof DC Universe Green titleof 001 Lantern nameof genreof volumeof genreof Volume 1 Sci Fi Superhero genreof issueof genreof 002 precedes Issue #2 number coverof #1 003 Saturday, September 12, 2009
  91. 91. require 'neo4j' Neo4j::Transaction.run do dc = Neo4j::Node.new dc[:name] = 'DC' dc_universe = Neo4j::Node.new dc_universe[:name] = 'DC Universe' dc.relationships.outgoing(:imprints) << dc_universe rel = dc.relationships.outgoing(:imprints).first rel[:started] = 1980 vol1 = Neo4j::Node.new vol1[:started] = 1941 vol1[:ended] = 1949 vol1[:name] = 'Green Lantern' dc.relationships.outgoing(:titles) << vol1 dc_universe.relationships.outgoing(:titles) << vol1 # ... end Saturday, September 12, 2009
  92. 92. Other Options Saturday, September 12, 2009
  93. 93. Column-Oriented http://internetmindmap.com/database_software Saturday, September 12, 2009
  94. 94. Column-Oriented Temporal http://internetmindmap.com/database_software Saturday, September 12, 2009
  95. 95. Column-Oriented Temporal Constant http://internetmindmap.com/database_software Saturday, September 12, 2009
  96. 96. Column-Oriented Temporal Constant ? http://internetmindmap.com/database_software Saturday, September 12, 2009
  97. 97. Polyglot Persistence Saturday, September 12, 2009
  98. 98. I am your databases... combined! flickr: joriel Saturday, September 12, 2009
  99. 99. Saturday, September 12, 2009
  100. 100. Saturday, September 12, 2009
  101. 101. post tag document id { 'title':'Post Title' 'content':'Hello!' 'comments':["First!"] } Saturday, September 12, 2009
  102. 102. Saturday, September 12, 2009
  103. 103. { 'name':'...' 'attr1':'...' 'attr7':'...' } Saturday, September 12, 2009
  104. 104. The power is yours flickr: joriel Saturday, September 12, 2009
  105. 105. Thank You ben scofield - @bscofield http://benscofield.com http://www.viget.com/extend http://www.speakerrate.com/bscofield Saturday, September 12, 2009

×