SlideShare a Scribd company logo
AURELIUS 
THINKAURELIUS.COM 
Titan:db 
Graphs at Scale 
#TitanDB 
Matthias Broecheler 
@mbroecheler 
December 2nd, MMXIV
software is eating 
the world
>;N; >LCP?H 
software is eating 
the world
Tabular 
Relational
Tabular 
Relational 
Flexibility 
Handling 
NoSQL
Tabular 
Relational 
Flexibility 
Handling 
Data Model 
Query Language 
NoSQL
Tabular 
Relational 
NoSQL 
Graph 
Flexibility 
Handling 
Data Model 
Query Language 
Simplicity 
Flexibility 
Handling 
Data Model 
Query Language
productid: 52235 
name: cup 
price: 12.55 
userid: matt 
email: matt@ 
password: 12345 
User 
Product
User 
Product 
userid 
email 
password 
ma. 
ma.@ 
12345 
john 
john@ 
qwerty 
billy 
billy@ 
abcde 
produc=d 
name 
price 
52235 
cup 
12.55 
42215 
spoon 
7.22 
24529 
knife 
5.32
productid: 52235 
name: cup 
price: 12.55 
userid: matt 
email: matt@ 
password: 12345 
User 
Product 
buy 
time: 9/5/14
User 
Product 
userid 
email 
password 
ma. 
ma.@ 
12345 
john 
john@ 
qwerty 
billy 
billy@ 
abcde 
produc=d 
name 
price 
52235 
cup 
12.55 
42215 
spoon 
7.22 
24529 
knife 
5.32 
userid 
produc=d 
=me 
ma. 
52235 
9/5/14 
billy 
42215 
8/7/14 
billy 
42215 
8/7/14 
Buy
Titan: Scaling Graphs and TinkerPop3
7B;N >C> -;NN <OSg 
g.V.has(‘email’,’matt@’).out(‘buy’).valueMap!
7B;N >C> -;NN <OSg 
SELECT Product.* ! 
FROM User! 
INNER JOIN Buy ! 
!ON User.userid = Buy.userid! 
INNER JOIN Product ! 
!ON Buy.productid = Product.productid! 
WHERE User.email = ‘matt@’ !
SELECT TOP (5) [t14].[ProductName] 
FROM (SELECT COUNT(*) AS [value], 
[t13].[ProductName] 
FROM [customers] AS [t0] 
CROSS APPLY (SELECT [t9].[ProductName] 
FROM [orders] AS [t1] 
CROSS JOIN [order details] AS [t2] 
INNER JOIN [products] AS [t3] 
ON [t3].[ProductID] = [t2].[ProductID] 
CROSS JOIN [order details] AS [t4] 
INNER JOIN [orders] AS [t5] 
ON [t5].[OrderID] = [t4].[OrderID] 
LEFT JOIN [customers] AS [t6] 
ON [t6].[CustomerID] = [t5].[CustomerID] 
CROSS JOIN ([orders] AS [t7] 
CROSS JOIN [order details] AS [t8] 
INNER JOIN [products] AS [t9] 
ON [t9].[ProductID] = [t8].[ProductID]) 
WHERE NOT EXISTS(SELECT NULL AS [EMPTY] 
FROM [orders] AS [t10] 
CROSS JOIN [order details] AS [t11] 
INNER JOIN [products] AS [t12] 
ON [t12].[ProductID] = [t11].[ProductID] 
WHERE [t9].[ProductID] = [t12].[ProductID] 
AND [t10].[CustomerID] = [t0].[CustomerID] 
AND [t11].[OrderID] = [t10].[OrderID]) 
AND [t6].[CustomerID] <> [t0].[CustomerID] 
AND [t1].[CustomerID] = [t0].[CustomerID] 
AND [t2].[OrderID] = [t1].[OrderID] 
AND [t4].[ProductID] = [t3].[ProductID] 
AND [t7].[CustomerID] = [t6].[CustomerID] 
AND [t8].[OrderID] = [t7].[OrderID]) AS [t13] 
WHERE [t0].[CustomerID] = N'ALFKI' 
GROUP BY [t13].[ProductName]) AS [t14] 
ORDER BY [t14].[value] DESC
g.V.has('customerId’,cid).as('customer') 
.out('orderedProduct’).as('products') 
.in('orderedProduct').except('customer') 
.out('orderedProduct’).except('products') 
.productName.groupCount.cap. 
.map{it.sort{-it.value}}.next()[0..<5] 
h.p://sql2gremlin.com/
TinkerPop 3 
coming soon 
Graph 
Server 
Graph 
Algorithms 
Object-Graph 
Mapper 
Traversal 
Language 
Dataflow 
Processing 
Generic 
Graph API 
http://www.tinkerpop.com/docs/3.0.0.M6/
label: demigod 
name: Hercules 
label: god 
name: Neptune 
age: 4500 
brothermother 
label: god 
name: Jupiter 
label: monster 
name: Cerberus 
father 
father 
brother 
battled 
pet 
time:12 
label: god 
name: Pluto 
age: 4000 
label: human 
name: Alcmene 
age: 45 
label: titan 
name: Saturn 
age: 10000 
label: monster 
name: Hydra 
battled 
time: 2
AURELIUS 
THINKAURELIUS.COM 
Titan:db 
Architecture & Internals 
titandb.io
Architecture Analogy 
MyISAM
Flexible Persistence 
Partitionability 
ConsistencyAvailability
Graph Schema 
! Labels & Keys 
! Vertex Property Cardinality 
! Single, Set, List 
! Edge Multiplicity 
! Multi, Simple, Many2One, One2Many, 
One2One 
! Constraints & Consistency
I. Navigate Memory
Sequential Data Access
Vertex Representation 
5 
Property 
Property 
Out-Edge 
In-Edge 
Out-Edge 
In-Edge 
In-Edge 
LIQ CH>C=?M 
@IL @;MN 
P?LN?R =?HNLC= 
KO?LC?M 
<SN? IL>?L MILNCHA 
=?FF t 
=IFOGH q 
P;FO? 
LIQ 
E?S
Vertex-Centric Index 
! Create a vertex-centric index per edge label 
or property key to optimize for retrieval 
patterns 
! Through Titan’s management API 
! Supports multiple indexes 
name: Hercules 
surname: Mighty 
label: user 
time:24 
bought 
title: “Muscle building for beginners” 
label: product 
[bought, time, DESC]
battled 
battled 
battled 
time: 3 
time: 5 
v 
time: 1 
fatherfought 
fought 
mother 
battled 
time: 9 
v!
battled 
battled 
battled 
time: 3 
time: 5 
v 
time: 1 
mother 
father 
battled 
time: 9 
v.outE()!
battled 
battled 
battled 
time: 3 
time: 5 
v 
time: 1 
battled 
time: 9 
v.outE(‘battled’)!
v 
battled 
battled 
time: 1 
time: 3 
v.outE(‘battled’)! 
.has(‘time’,lt,5)! 
.inV!
Faster Querying 
! Multi-Query 
! Bulk querying reduces latency 
! Currently manual 
! Order in vertex-centric 
query 
! Adjacency-constraint 
! Faster edge retrievals 
" Titan Query Optimizer
Graph Index 
! Composite internal index 
! Can be unique 
! Label specific index 
! Multiple external indexes 
label: user 
name: Hercules 
surname: Mighty 
time:24 
bought 
label: product 
title: “Muscle building for beginners”
g.E.has(‘location’,WITHIN, 
Geoshape.circle(38,24,50)! 
Full text & Geo 
Search
Token Ring 
(BOP) 
Graph Partitioning 
- assigns ids to map 
vertices into “optimal” 
token range 
- Maintains virtual 
partitions 
Vertical Partitioning = divide communities
Vertex Partitioning 
Each partition contains one 
“part” of a partitioned vertex 
Horizontal Partitioning = split super vertices
Combined Partitioning
label: demigod 
name: Hercules 
label: god 
name: Neptune 
age: 4500 
brothermother 
label: god 
name: Jupiter 
label: monster 
name: Cerberus 
father 
father 
brother 
battled 
pet 
time:12 
label: god 
name: Pluto 
age: 4000 
label: human 
name: Alcmene 
age: 45 
label: titan 
name: Saturn 
age: 10000 
label: monster 
name: Hydra 
battled 
time: 2 
OLTP
label: demigod 
name: Hercules 
label: god 
name: Neptune 
age: 4500 
brothermother 
label: god 
name: Jupiter 
label: monster 
name: Cerberus 
father 
father 
brother 
battled 
pet 
time:12 
label: god 
name: Pluto 
age: 4000 
label: human 
name: Alcmene 
age: 45 
label: titan 
name: Saturn 
age: 10000 
label: monster 
name: Hydra 
battled 
time: 2 
OLAP
Faunus Work Flow 
g.V.out .out .count() 
hdfs://user/ubuntu/ 
output/job-0/ 
output/job-1/ 
output/job-2/ { graph* 
sideeffect* 
Compressed HDFS Graphs 
! stored in sequence files 
! variable length encoding 
! prefix compression
Degree Distribution 
GitHub Network 
g.V.sideEffect{ 
it.degree = it.out(‘follows’).count() 
}.degree.groupCount
Degree Distribution 
P(k) ~ k-γ 
γ = 2.2
Complete Architecture 
! 
Users & Apps 
Processing 
Event 
OLTP 
OLAP 
Q 
Continuous 
Computing 
Interactive 
Query 
Batch 
Query 
(ETL)
Use Cases
http://arli.us/magazinaluiza
Security 
Fraud 
http://arli.us/cisco-sec1
http://arli.us/edu-planet-scale 
© Sean York @ Pearson Education
http://arli.us/musicgraphintro 
Music Graph 
Knowledge Graph
http://bit.ly/ 
WPTitanSEAGraph
7B?H NI OM? 'L;JB $;N;<;M?Mg 
Map+ 
NoSQL 
K 
V 
V 
V 
V 
Persistence 
Tabular 
Data-driven 
Graph
7B?H NI OM? 'L;JB $;N;<;M?Mg 
Map+ 
NoSQL 
K 
V 
V 
V 
V 
Persistence 
Tabular 
Data-driven 
Graph 
Complexity
AURELIUS 
THINKAURELIUS.COM 
@AURELIUSGRAPHS 
aureliusgraphs@googlegroups.com

More Related Content

PPTX
Data Vault 2.0: Big Data Meets Data Warehousing
PPTX
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it too
PPTX
NoSQL Endgame JCON Conference 2020
PPTX
OrientDB vs Neo4j - and an introduction to NoSQL databases
PPTX
Extreme BI: Creating Virtualized Hybrid Type 1+2 Dimensions
PPTX
Query in Couchbase. N1QL: SQL for JSON
PDF
Data Vault 2.0: Using MD5 Hashes for Change Data Capture
PPTX
NoSQL Endgame LWJUG 2021
Data Vault 2.0: Big Data Meets Data Warehousing
Querying NoSQL with SQL: HAVING Your JSON Cake and SELECTing it too
NoSQL Endgame JCON Conference 2020
OrientDB vs Neo4j - and an introduction to NoSQL databases
Extreme BI: Creating Virtualized Hybrid Type 1+2 Dimensions
Query in Couchbase. N1QL: SQL for JSON
Data Vault 2.0: Using MD5 Hashes for Change Data Capture
NoSQL Endgame LWJUG 2021

What's hot (20)

PDF
Big query
PPT
Data Binding In Depth
PDF
Redshift VS BigQuery
PDF
Graph database Use Cases
PPTX
Offline First Apps With Couchbase Mobile and Xamarin
PPTX
Visual Data Vault
PDF
Agile Data Engineering: Introduction to Data Vault 2.0 (2018)
PPTX
N1QL workshop: Indexing & Query turning.
PDF
OrientDB: Unlock the Value of Document Data Relationships
PDF
(OTW13) Agile Data Warehousing: Introduction to Data Vault Modeling
PPTX
Joins and Other MongoDB 3.2 Aggregation Enhancements
PDF
Key note big data analytics ecosystem strategy
PDF
Making Sense of Schema on Read
PDF
Webinar: Introducing the MongoDB Connector for BI 2.0 with Tableau
PDF
Michael Hackstein - Polyglot Persistence & Multi-Model NoSQL Databases - NoSQ...
PDF
Democratizing Data at Airbnb
PPTX
MongoDB World 2016: Keynote
PPT
Using OBIEE and Data Vault to Virtualize Your BI Environment: An Agile Approach
PDF
Hybrid solutions – combining in memory solutions with SSD - Christos Erotocritou
PDF
OrientDB & Node.js Overview - JS.Everywhere() KW
Big query
Data Binding In Depth
Redshift VS BigQuery
Graph database Use Cases
Offline First Apps With Couchbase Mobile and Xamarin
Visual Data Vault
Agile Data Engineering: Introduction to Data Vault 2.0 (2018)
N1QL workshop: Indexing & Query turning.
OrientDB: Unlock the Value of Document Data Relationships
(OTW13) Agile Data Warehousing: Introduction to Data Vault Modeling
Joins and Other MongoDB 3.2 Aggregation Enhancements
Key note big data analytics ecosystem strategy
Making Sense of Schema on Read
Webinar: Introducing the MongoDB Connector for BI 2.0 with Tableau
Michael Hackstein - Polyglot Persistence & Multi-Model NoSQL Databases - NoSQ...
Democratizing Data at Airbnb
MongoDB World 2016: Keynote
Using OBIEE and Data Vault to Virtualize Your BI Environment: An Agile Approach
Hybrid solutions – combining in memory solutions with SSD - Christos Erotocritou
OrientDB & Node.js Overview - JS.Everywhere() KW
Ad

Viewers also liked (20)

PPTX
Neo, Titan & Cassandra
PDF
Intro to Graph Databases Using Tinkerpop, TitanDB, and Gremlin
PDF
Titan: Big Graph Data with Cassandra
PDF
Titan: The Rise of Big Graph Data
PPTX
Graph databases: Tinkerpop and Titan DB
PDF
Graph Processing with Apache TinkerPop
PDF
DataStax: Titan 1.0: Scalable real time and analytic graph queries
PDF
Gremlin: A Graph-Based Programming Language
PDF
Introduction to TitanDB
ODP
Graphs are everywhere! Distributed graph computing with Spark GraphX
PDF
The Gremlin Graph Traversal Language
PDF
An overview of Neo4j Internals
PDF
Graph Computing @ Strangeloop 2013
PDF
Cassandra Summit 2014: TitanDB - Scaling Relationship Data and Analysis with ...
PDF
Corso base di Tecnologie WEB - una visione d'insieme
PDF
Addressing performance issues in titan+cassandra
PDF
The Path Forward
PDF
I linguaggi di programmazione e il mondo open-source
PDF
Apache Cassandra for Timeseries- and Graph-Data
PPTX
Data stax webinar cassandra and titandb insights into datastax graph strategy...
Neo, Titan & Cassandra
Intro to Graph Databases Using Tinkerpop, TitanDB, and Gremlin
Titan: Big Graph Data with Cassandra
Titan: The Rise of Big Graph Data
Graph databases: Tinkerpop and Titan DB
Graph Processing with Apache TinkerPop
DataStax: Titan 1.0: Scalable real time and analytic graph queries
Gremlin: A Graph-Based Programming Language
Introduction to TitanDB
Graphs are everywhere! Distributed graph computing with Spark GraphX
The Gremlin Graph Traversal Language
An overview of Neo4j Internals
Graph Computing @ Strangeloop 2013
Cassandra Summit 2014: TitanDB - Scaling Relationship Data and Analysis with ...
Corso base di Tecnologie WEB - una visione d'insieme
Addressing performance issues in titan+cassandra
The Path Forward
I linguaggi di programmazione e il mondo open-source
Apache Cassandra for Timeseries- and Graph-Data
Data stax webinar cassandra and titandb insights into datastax graph strategy...
Ad

Similar to Titan: Scaling Graphs and TinkerPop3 (20)

PDF
Polyglot ClickHouse -- ClickHouse SF Meetup Sept 10
PDF
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLBit...
PPT
IBM Insight 2015 - 1824 - Using Bluemix and dashDB for Twitter Analysis
PDF
Cassandra Tutorial
PDF
Patterns for key-value stores
PDF
Molecule Scala meta-DSL for Datomic
PDF
SQL Database Design & Querying
PDF
Pragmatic Patterns (and Pitfalls) for Event Streaming in Brownfield Environme...
PDF
Types Working for You, Not Against You
PPTX
A Little Graph Theory for the Busy Developer - Jim Webber @ GraphConnect Chic...
PDF
A Few of My Favorite (Python) Things
PPTX
OakTable World 2015 - Using XMLType content with the Oracle In-Memory Column...
PPTX
What the C?
PDF
Cobrix – a COBOL Data Source for Spark
PPTX
Postgres indexes: how to make them work for your application
PDF
League of Graphs
PDF
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
PPTX
It's Not You. It's Your Data Model.
PDF
JavaZone 2022 - Building Kotlin DSL.pdf
PPTX
Design Patterns for Building 360-degree Views with HBase and Kiji
Polyglot ClickHouse -- ClickHouse SF Meetup Sept 10
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLBit...
IBM Insight 2015 - 1824 - Using Bluemix and dashDB for Twitter Analysis
Cassandra Tutorial
Patterns for key-value stores
Molecule Scala meta-DSL for Datomic
SQL Database Design & Querying
Pragmatic Patterns (and Pitfalls) for Event Streaming in Brownfield Environme...
Types Working for You, Not Against You
A Little Graph Theory for the Busy Developer - Jim Webber @ GraphConnect Chic...
A Few of My Favorite (Python) Things
OakTable World 2015 - Using XMLType content with the Oracle In-Memory Column...
What the C?
Cobrix – a COBOL Data Source for Spark
Postgres indexes: how to make them work for your application
League of Graphs
Tools and Tips: From Accidental to Efficient Data Warehouse Developer (SQLSat...
It's Not You. It's Your Data Model.
JavaZone 2022 - Building Kotlin DSL.pdf
Design Patterns for Building 360-degree Views with HBase and Kiji

More from Matthias Broecheler (12)

PDF
Titan @ Gitpro Conference 2014
PPTX
Titan NYC Meetup March 2014
PDF
Titan - Graph Computing with Cassandra
PDF
Data Day Texas 2013
PDF
Adding Value through graph analysis using Titan and Faunus
PDF
Big Graph Data
PDF
PMatch: Probabilistic Subgraph Matching on Huge Social Networks
PDF
Budget-Match: Cost Effective Subgraph Matching on Large Networks
PDF
Probabilistic Soft Logic
PDF
Computing Marginal in CCMRFs - NIPS 2010
PDF
A Scalable Framework for Modeling Competitive Diffusion in Social Networks
PDF
COSI: Cloud Oriented Subgraph Identification in Massive Social Networks
Titan @ Gitpro Conference 2014
Titan NYC Meetup March 2014
Titan - Graph Computing with Cassandra
Data Day Texas 2013
Adding Value through graph analysis using Titan and Faunus
Big Graph Data
PMatch: Probabilistic Subgraph Matching on Huge Social Networks
Budget-Match: Cost Effective Subgraph Matching on Large Networks
Probabilistic Soft Logic
Computing Marginal in CCMRFs - NIPS 2010
A Scalable Framework for Modeling Competitive Diffusion in Social Networks
COSI: Cloud Oriented Subgraph Identification in Massive Social Networks

Recently uploaded (20)

PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
iTop VPN Crack Latest Version Full Key 2025
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PPTX
Tech Workshop Escape Room Tech Workshop
PPTX
"Secure File Sharing Solutions on AWS".pptx
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PPTX
assetexplorer- product-overview - presentation
PPTX
Introduction to Windows Operating System
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PDF
STL Containers in C++ : Sequence Container : Vector
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
iTop VPN Crack Latest Version Full Key 2025
Salesforce Agentforce AI Implementation.pdf
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
Tech Workshop Escape Room Tech Workshop
"Secure File Sharing Solutions on AWS".pptx
Patient Appointment Booking in Odoo with online payment
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
Complete Guide to Website Development in Malaysia for SMEs
DNT Brochure 2025 – ISV Solutions @ D365
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Designing Intelligence for the Shop Floor.pdf
Oracle Fusion HCM Cloud Demo for Beginners
assetexplorer- product-overview - presentation
Introduction to Windows Operating System
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
Computer Software and OS of computer science of grade 11.pptx
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
STL Containers in C++ : Sequence Container : Vector

Titan: Scaling Graphs and TinkerPop3

  • 1. AURELIUS THINKAURELIUS.COM Titan:db Graphs at Scale #TitanDB Matthias Broecheler @mbroecheler December 2nd, MMXIV
  • 2. software is eating the world
  • 3. >;N; >LCP?H software is eating the world
  • 6. Tabular Relational Flexibility Handling Data Model Query Language NoSQL
  • 7. Tabular Relational NoSQL Graph Flexibility Handling Data Model Query Language Simplicity Flexibility Handling Data Model Query Language
  • 8. productid: 52235 name: cup price: 12.55 userid: matt email: matt@ password: 12345 User Product
  • 9. User Product userid email password ma. ma.@ 12345 john john@ qwerty billy billy@ abcde produc=d name price 52235 cup 12.55 42215 spoon 7.22 24529 knife 5.32
  • 10. productid: 52235 name: cup price: 12.55 userid: matt email: matt@ password: 12345 User Product buy time: 9/5/14
  • 11. User Product userid email password ma. ma.@ 12345 john john@ qwerty billy billy@ abcde produc=d name price 52235 cup 12.55 42215 spoon 7.22 24529 knife 5.32 userid produc=d =me ma. 52235 9/5/14 billy 42215 8/7/14 billy 42215 8/7/14 Buy
  • 13. 7B;N >C> -;NN <OSg g.V.has(‘email’,’matt@’).out(‘buy’).valueMap!
  • 14. 7B;N >C> -;NN <OSg SELECT Product.* ! FROM User! INNER JOIN Buy ! !ON User.userid = Buy.userid! INNER JOIN Product ! !ON Buy.productid = Product.productid! WHERE User.email = ‘matt@’ !
  • 15. SELECT TOP (5) [t14].[ProductName] FROM (SELECT COUNT(*) AS [value], [t13].[ProductName] FROM [customers] AS [t0] CROSS APPLY (SELECT [t9].[ProductName] FROM [orders] AS [t1] CROSS JOIN [order details] AS [t2] INNER JOIN [products] AS [t3] ON [t3].[ProductID] = [t2].[ProductID] CROSS JOIN [order details] AS [t4] INNER JOIN [orders] AS [t5] ON [t5].[OrderID] = [t4].[OrderID] LEFT JOIN [customers] AS [t6] ON [t6].[CustomerID] = [t5].[CustomerID] CROSS JOIN ([orders] AS [t7] CROSS JOIN [order details] AS [t8] INNER JOIN [products] AS [t9] ON [t9].[ProductID] = [t8].[ProductID]) WHERE NOT EXISTS(SELECT NULL AS [EMPTY] FROM [orders] AS [t10] CROSS JOIN [order details] AS [t11] INNER JOIN [products] AS [t12] ON [t12].[ProductID] = [t11].[ProductID] WHERE [t9].[ProductID] = [t12].[ProductID] AND [t10].[CustomerID] = [t0].[CustomerID] AND [t11].[OrderID] = [t10].[OrderID]) AND [t6].[CustomerID] <> [t0].[CustomerID] AND [t1].[CustomerID] = [t0].[CustomerID] AND [t2].[OrderID] = [t1].[OrderID] AND [t4].[ProductID] = [t3].[ProductID] AND [t7].[CustomerID] = [t6].[CustomerID] AND [t8].[OrderID] = [t7].[OrderID]) AS [t13] WHERE [t0].[CustomerID] = N'ALFKI' GROUP BY [t13].[ProductName]) AS [t14] ORDER BY [t14].[value] DESC
  • 16. g.V.has('customerId’,cid).as('customer') .out('orderedProduct’).as('products') .in('orderedProduct').except('customer') .out('orderedProduct’).except('products') .productName.groupCount.cap. .map{it.sort{-it.value}}.next()[0..<5] h.p://sql2gremlin.com/
  • 17. TinkerPop 3 coming soon Graph Server Graph Algorithms Object-Graph Mapper Traversal Language Dataflow Processing Generic Graph API http://www.tinkerpop.com/docs/3.0.0.M6/
  • 18. label: demigod name: Hercules label: god name: Neptune age: 4500 brothermother label: god name: Jupiter label: monster name: Cerberus father father brother battled pet time:12 label: god name: Pluto age: 4000 label: human name: Alcmene age: 45 label: titan name: Saturn age: 10000 label: monster name: Hydra battled time: 2
  • 19. AURELIUS THINKAURELIUS.COM Titan:db Architecture & Internals titandb.io
  • 21. Flexible Persistence Partitionability ConsistencyAvailability
  • 22. Graph Schema ! Labels & Keys ! Vertex Property Cardinality ! Single, Set, List ! Edge Multiplicity ! Multi, Simple, Many2One, One2Many, One2One ! Constraints & Consistency
  • 25. Vertex Representation 5 Property Property Out-Edge In-Edge Out-Edge In-Edge In-Edge LIQ CH>C=?M @IL @;MN P?LN?R =?HNLC= KO?LC?M <SN? IL>?L MILNCHA =?FF t =IFOGH q P;FO? LIQ E?S
  • 26. Vertex-Centric Index ! Create a vertex-centric index per edge label or property key to optimize for retrieval patterns ! Through Titan’s management API ! Supports multiple indexes name: Hercules surname: Mighty label: user time:24 bought title: “Muscle building for beginners” label: product [bought, time, DESC]
  • 27. battled battled battled time: 3 time: 5 v time: 1 fatherfought fought mother battled time: 9 v!
  • 28. battled battled battled time: 3 time: 5 v time: 1 mother father battled time: 9 v.outE()!
  • 29. battled battled battled time: 3 time: 5 v time: 1 battled time: 9 v.outE(‘battled’)!
  • 30. v battled battled time: 1 time: 3 v.outE(‘battled’)! .has(‘time’,lt,5)! .inV!
  • 31. Faster Querying ! Multi-Query ! Bulk querying reduces latency ! Currently manual ! Order in vertex-centric query ! Adjacency-constraint ! Faster edge retrievals " Titan Query Optimizer
  • 32. Graph Index ! Composite internal index ! Can be unique ! Label specific index ! Multiple external indexes label: user name: Hercules surname: Mighty time:24 bought label: product title: “Muscle building for beginners”
  • 34. Token Ring (BOP) Graph Partitioning - assigns ids to map vertices into “optimal” token range - Maintains virtual partitions Vertical Partitioning = divide communities
  • 35. Vertex Partitioning Each partition contains one “part” of a partitioned vertex Horizontal Partitioning = split super vertices
  • 37. label: demigod name: Hercules label: god name: Neptune age: 4500 brothermother label: god name: Jupiter label: monster name: Cerberus father father brother battled pet time:12 label: god name: Pluto age: 4000 label: human name: Alcmene age: 45 label: titan name: Saturn age: 10000 label: monster name: Hydra battled time: 2 OLTP
  • 38. label: demigod name: Hercules label: god name: Neptune age: 4500 brothermother label: god name: Jupiter label: monster name: Cerberus father father brother battled pet time:12 label: god name: Pluto age: 4000 label: human name: Alcmene age: 45 label: titan name: Saturn age: 10000 label: monster name: Hydra battled time: 2 OLAP
  • 39. Faunus Work Flow g.V.out .out .count() hdfs://user/ubuntu/ output/job-0/ output/job-1/ output/job-2/ { graph* sideeffect* Compressed HDFS Graphs ! stored in sequence files ! variable length encoding ! prefix compression
  • 40. Degree Distribution GitHub Network g.V.sideEffect{ it.degree = it.out(‘follows’).count() }.degree.groupCount
  • 41. Degree Distribution P(k) ~ k-γ γ = 2.2
  • 42. Complete Architecture ! Users & Apps Processing Event OLTP OLAP Q Continuous Computing Interactive Query Batch Query (ETL)
  • 49. 7B?H NI OM? 'L;JB $;N;<;M?Mg Map+ NoSQL K V V V V Persistence Tabular Data-driven Graph
  • 50. 7B?H NI OM? 'L;JB $;N;<;M?Mg Map+ NoSQL K V V V V Persistence Tabular Data-driven Graph Complexity
  • 51. AURELIUS THINKAURELIUS.COM @AURELIUSGRAPHS aureliusgraphs@googlegroups.com