Graph Databases
Marco Serafini
COMPSCI 532 Lecture 10
Graph Databases Marco Serafini COMPSCI 532 Lecture 10 Graph DB - - PowerPoint PPT Presentation
Graph Databases Marco Serafini COMPSCI 532 Lecture 10 Graph DB Use cases Social network queries E.g. Facebook stores the entire metadata in a social graph Network security Find sequence of steps that lead to intrusion
COMPSCI 532 Lecture 10
2
33
44
From S. Decker et al., “Framework for the Semantic Web: An RDF Tutorial”
55
PREFIX sn: http://socialnetwork.com/ontology/ SELECT ?friend WHERE { ?user sn:hasName “alice01”; sn:isFriendOf ?friend. ?friend sn:livesIn sn:Paris. }
66
77
MATCH (u:User)-[:isFriend]->(f:User)–[:livesIn]->(:City {name: ‘Paris’}) WHERE (u.name = ‘Alice’) RETURN f.name
88
99
10
10
11
11
100 100 heavyweight 104 subgraphs * 2 edge lookups v v single starting vertex multiple matching vertices 10 10 10 10 10*10 lightweight 220 edge lookups 10*10
12
12
13
13 Running time (ms)
14
14
15
15
16
16
UPDATES TRANSACTIONAL SYSTEM ANALYTICAL SYSTEM RESULTS LOAD DYNAMIC DATA STRUCTURE + TRANSACTIONS READ-ONLY DATA STRUCTURE NO TRANSACTIONS E.g.: B-Tree, LSMT E.g.: CSR
17
17
220 221 222 223 224 225 226 graph scale, V
0.01 0.1 1 10
cache miss/edge
TEL LSMT B+Tree Linked List
220 221 222 223 224 225 226 graph scale, V
0.1 1 10 100
µs/vertex (seeks)
TEL LSMT B+Tree Linked List
Cache misses Seek time Edge scan
220 221 222 223 224 225 226 graph scale, V
10 100 1000
ns/edge (scan)
TEL LSMT B+Tree Linked List
18
18