Charlotte.rb - "Comics" Is Hard
Upcoming SlideShare
Loading in...5
×
 

Charlotte.rb - "Comics" Is Hard

on

  • 2,642 views

Domain modeling/alternative database presentation given at Charlotte.rb

Domain modeling/alternative database presentation given at Charlotte.rb

Statistics

Views

Total Views
2,642
Views on SlideShare
1,899
Embed Views
743

Actions

Likes
1
Downloads
16
Comments
1

8 Embeds 743

http://charlotteruby.org 398
http://localhost:4000 243
http://charlotte-ruby.github.com 63
http://coderwall.com 25
http://a.eval.me:4000 11
http://blog.jroes.net 1
http://www.slideshare.net 1
http://localhost:3000 1
More...

Accessibility

Upload Details

Uploaded via as Apple Keynote

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…
  • high volume 64Mbytes.....
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • bad diagram - self-referential join in taxon table
  • TIGON - Tiger + Lioness <br /> Ernst Mayr: &#x201C;groups of actually or potentially interbreeding natural populations, which are reproductively isolated from other such groups&#x201D;
  • tomatoes - hybrids & heirlooms
  • PLUOT <br /> Plum + Apricot
  • Caminalcules (from Camin and animalcule) are a group of animal-like life forms invented by Professor Joseph H. Camin (University of Kansas) as a tool for understanding phylogenetics. Interested in how taxonomists group species, he designed these creatures to show an evolutionary pattern of divergence and diversification in morphology. There are 29 recent &apos;species&apos; of Caminalcules and 48 fossil forms.
  • bad diagram - self-referential join in taxon table
  • problems with cladistics: historical change is hard to see, and cladistics gives you CRAZY counter-intuitive results
  • this is a little naive - titles can change imprints; in some cases, retroactively
  • ISSUES <br /> collected in diff trades
  • volume has-many trades <br /> trade has-many issues <br /> issue has-many trades
  • diff covers, and sometimes internal art
  • favorite variant cover of all time...
  • issue has-many variants (incl covers, writing, art)
  • issue has-many variants (incl covers, writing, art)
  • call attention to the title change (ala Aquaman) <br /> numbering changes: CAC started with #1 in 1941
  • call attention to the title change (ala Aquaman) <br /> numbering changes: CAC started with #1 in 1941
  • most recent volume of Cap started in 2005 -> #50 <br /> then renumbered #600
  • most recent volume of Cap started in 2005 -> #50 <br /> then renumbered #600
  • Fallen Angel -- DC => IDW
  • could be implemented as tagging
  • just because you can model relationships in these alt DBs, doesn&#x2019;t mean you should. YOU SHOULDN&#x2019;T!
  • Cassandra inherits from Amazon&#x2019;s Dynamo and Google&#x2019;s BigTable - eventual consistency, rich data model
  • for more information
  • CouchDB - HTTP <br /> Mongo - socket???
  • both use JSON
  • MongoMapper from John Nunemaker
  • for more information
  • Perfect use for document DB: CMS with custom fields
  • RDF / Web 2.0 <br /> 30 years old, finally coming into its own
  • back to the blog example
  • tags don&#x2019;t fit in the document model
  • baby steps: polyglotting applications and/or web services
  • step two: connect to couch via HTTP directly (couch application)
  • step three: polyglot away!
  • step three: polyglot away!

Charlotte.rb - "Comics" Is Hard Charlotte.rb - "Comics" Is Hard Presentation Transcript

  • “Comics” Is Hard: On Domains and Databases Ben Sco eld – Viget Labs
  • domains
  • biology
  • Kingdom Animalia Phylum Chordata Class Mammalia Order Carnivora Family Felidae Genus Panthera Species tigris ickr: pandiyan
  • Animalia Chordata Mammalia Carnivora Felidae Panthera tigris ickr: pandiyan
  • kingdoms phyla classes orders families genera species
  • Problem The levels are imaginary
  • kingdoms subphyla phyla superclasses subclasses classes superorders suborders orders superfamilies subfamilies families subgenera genera subspecies species varieties
  • kingdoms subphyla phyla superclasses subclasses ? classes superorders suborders orders superfamilies subfamilies families subgenera genera subspecies species varieties
  • taxa subspecies species varieties
  • Species ickr: cpurrin1
  • Reproductive Isolation ickr: superciliousness
  • Reproductive Isolation ickr: superciliousness
  • ickr: chiotsrun
  • ickr: niznoz
  • Numerical taxonomy
  • Cladistics
  • clades organisms
  • Problem Cladistics is historical and counter-intuitive
  • ickr: goellnitz
  • ickr: goellnitz pcoin
  • The Challenge Unclear, imprecise domain
  • comics
  • publishers titles issues
  • publishers imprints titles issues
  • publishers imprints titles volumes issues
  • publishers imprints titles volumes trades issues reprints
  • publishers imprints titles volumes trades issues reprints variants
  • publishers imprints titles names volumes trades issues reprints variants
  • publishers imprints ? titles names volumes trades issues reprints nested set? variants
  • publishers imprints ?!?! titles names volumes trades issues reprints nested set? variants
  • science fiction noir horror genres? independent Martial Arts historical superhero Pirate
  • publishers imprints #&*! titles names volumes trades genres issues reprints nested set? variants
  • The Challenge Complete insanity
  • nosql altdb postrelational lesssql
  • http://thisisindexed.com/2009/02/just-because-you-can-doesnt-mean-you-should/
  • key-value stores
  • dynomite tokyo cabinet project voldemort pstore redis
  • 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/
  • Biology x Comics x
  • Configuration ✓ Caching ✓ Translations ✓
  • document databases
  • couchdb jackrabbit mongodb rddb riak
  • { 'name':'Ben Scofield', 'twitter':'@bscofield' } { 'name':'Jim Van Fleet', 'adjective':'awesomesauce' }
  • 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
  • Biology ✓ Comics x
  • { ‘kingdom’:‘Animalia’, ‘phylum’:‘Chordata’, ‘subphylum’:‘Vertebrata’, ‘class’:‘Mammalia’, ‘subclass’:‘Eutheria’, ‘order’:‘Carnivora’, ‘family’:‘Felidae’, ‘subfamily’:‘Panthernae’, ‘genus’:‘Pantera’, ‘species’:‘tigris’, ‘name’:‘Wanda’ }
  • { ‘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’ }
  • graph databases
  • allegograph hypergraphdb neo4j activeRDF
  • http://neotechnology.com/why-neo
  • http://markorodriguez.com/Lectures_ les/risk-symposium2009.pdf
  • ickr: 9948354@N08
  • Biology ✓ Comics ✓
  • Animalia ... Felidae subfamilyof genusof Panthernae genusof Panthera speciesof tigris member 001 age name weight 3 Wanda 300
  • Animalia ... Felidae subfamilyof genusof Panthernae genusof Panthera species speciesof type tigris 010 name tigris member 001 age name weight 3 Wanda 300
  • Group IV orderof Picornavirales familyof Picornaviridae genusof Rhinovirus speciesof human rhinovirus A member 002
  • 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
  • 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
  • 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
  • other alternatives
  • column-oriented constant in-memory streaming temporal
  • selection
  • None Key-Value Many-One Document-Oriented Many-Many Relational Many-Many ++ Graph
  • polyglot persistence
  • { ‘title’:‘I Love Cheese’ ‘content’:‘Cheese is...’ ‘posted’:’24 Sept 2009’ ‘comments’:[{ ‘author’:‘Joe Schmoe’ ‘posted’:’24 Sept 2009’ ‘content’:‘First!’ }, {...}] }
  • Tag Tag Post General Life 1ec8264 Work Food 1ec8264 Fitness Writing bae294a Life Food Writing { ‘title’:‘I Love Cheese’ Family ‘content’:‘Cheese is...’ ‘posted’:’24 Sept 2009’ ‘comments’:[{ ‘author’:‘Joe Schmoe’ ‘posted’:’24 Sept 2009’ ‘content’:‘First!’ }, {...}] }
  • HTTP application application
  • HTTP application
  • application
  • application
  • Thank You ben sco eld - @bsco eld http://bensco eld.com http://www.viget.com/extend http://www.speakerrate.com/bsco eld