Upload
ben-scofield
View
1.321
Download
2
Tags:
Embed Size (px)
DESCRIPTION
Given at Developer Day Boston on August 15th
Citation preview
“Comics” Is Hard:Alternative DatabasesBen Scofield – Viget Labs
1
Modeling
flickr: bunchofpants
2
Biology
3
Linnean taxonomy4
AnimaliaChordataMammaliaCarnivoraFelidaePantheratigris
KingdomPhylumClassOrderFamilyGenusSpecies
flickr: pandiyan
5
AnimaliaChordataMammaliaCarnivoraFelidaePantheratigris
flickr: pandiyan
5
kingdom phylum class
genus family order
species organism
6
ProblemThe levels are imaginary
7
kingdom phylum class
genus family order
species organism
subphylum
superclass subclass
superordersuborder
superfamily
subfamily
subgenus
variety
subspecies
8
kingdom phylum class
genus family order
species organism
subphylum
superclass subclass
superordersuborder
superfamily
subfamily
subgenus
variety
subspecies
?8
taxon taxontaxon species organism
variety
subspecies
9
Speciesflickr: cpurrin1
10
Reproductive Isolationflickr: superciliousness
11
Reproductive Isolationflickr: superciliousness
11
12
13
flickr: niznoz
14
Numerical taxonomy15
Cladistics16
taxon taxon organismclade
17
ProblemCladistics is historical and
counter-intuitive
18
flickr: goellnitz
19
flickr: goellnitzflickr: pcoin
19
The ChallengeUnclear, imprecise domain
20
comics
21
publisher title issue
22
23
publisher imprint title
issue
24
25
publisher imprint title
issue volume
26
27
27
28
29
publisher imprint title
issue volume
trade
30
31
31
32
32
33
33
publisher imprint title
issue volume
tradevariant
34
35
35
36
36
publisher imprint title
issue volume
tradevariant
name
37
38
38
38
39
39
publisher imprint title
issue
nested set?volume
tradevariant
name
?
40
41
42
publisher
imprint
title
issue
nested set?volume
tradevariant
name
storyline ?!?!43
horror
superhero
Martial Arts
noir
Pirate
science fiction
independent
historical
genres?
44
publisherimprint
title
issue
nested set?volume
tradevariant
name
storyline
genre@#&*!45
The ChallengeComplete insanity
46
databases unite!
#?forben#?forben
Alternatives
flickr: ikhnaton2
47
http://thisisindexed.com/2009/02/just-because-you-can-doesnt-mean-you-should/
48
Key-Value
49
Cassandra*
Tokyo CabinetRedis
Project Voldemort
50
require "rubygems"require "tokyocabinet" include TokyoCabinet bdb = BDB::new # B-Tree database; keys may have multiple valuesbdb.open("casket.bdb", BDB::OWRITER | BDB::OCREAT) # store records in the database, allowing duplicatesbdb.putdup("key1", "value1")bdb.putdup("key1", "value2")bdb.put("key2", "value3")bdb.put("key3", "value4") # retrieve all valuesp bdb.getlist("key1")# => ["value1", "value2"] # range query, find all matching keysp bdb.range("key1", true, "key3", true)# => ["key1", "key2", "key3"]
http://www.igvita.com/2009/02/13/tokyo-cabinet-beyond-key-value-store/
51
Biology x
Comics x
52
Configuration ✓Caching ✓
Translations ✓
53
54
Document
55
56
{ 'name':'Ben Scofield', 'adjective':'awesomesauce'}
{ 'name':'Magic Pony', 'description':'It is a *lie*!'}
57
Biology ✓
Comics x
58
{ 'kingdom':'Animalia', ‘phylum’:‘Chordata’, ‘subphylum’:‘Vertebrata’, ‘class’:‘Mammalia’, ‘subclass’:‘Eutheria’, ‘order’:‘Carnivora’, ‘family’:‘Felidae’, ‘subfamily’:‘Panthernae’, ‘genus’:‘Pantera’, ‘species’:‘tigris’, ‘name’:‘Wanda’}
59
Graph
60
Java
AllegroGraphJava / Lisp
61
http://neotechnology.com/why-neo
62
http://markorodriguez.com/Lectures_files/risk-symposium2009.pdf
63
flickr: 9948354@N08
64
Biology ✓
Comics ✓
65
Felidae
001
tigris
Panthera
Panthernae
member
speciesof
Wanda
name
3
age
300
weight
genusof
Animalia
...
subfamilyof
genusof
66
Felidae
001
tigris
Panthera
Panthernae
member
speciesof
Wanda
name
3
age
300
weight
genusof
Animalia
...
subfamilyof
genusof
010
tigris
species
name
type
66
Picornaviridae
002
human
rhinovirus A
Rhinovirus
member
speciesof
genusof
Picornavirales
familyof
Group IV
orderof
67
Picornaviridae
002
human rhinovirus A
Rhinovirus
member
speciesof
genusof
Picornavirales
familyof
Group IV
orderof
Felidae
tigris
Panthera
Panthernae
speciesof
genusof
subfamilyof
genusof
001
member
Carnivora
familyof
Mammalia
orderof
class group
68
DC
001
DC Universe
titleof
imprintof
titleof
Volume 1
volumeof
Green
Lantern nameof
Sci Fi
genreof
genreof
genreof
002
issueof genreof
Superhero
Issue #2precedes
003
coverof
#1
number
69
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
70
flickr: joriel
Hybrid Solutions
71
72
72
tagpost
document id
{ 'title':'Post Title' 'content':'Hello!' 'comments':["First!"]}
73
74
user accounts and whatnot
{ 'name':'...' 'attr1':'...' 'attr7':'...'}
search
75
Thank Youben scofield - @bscofield
http://benscofield.comhttp://www.viget.com/extend
http://www.speakerrate.com/bscofield76