SlideShare a Scribd company logo
1 of 39
Download to read offline
AURELIUS
THINKAURELIUS.COM
Titan:db
Scaling Relationship Data with C*
Matthias Broecheler
@mbroecheler
September XI, MMXIV
#CassandraSummit
Storing relationship data in Cassandra entails data
denormalization or pointer chasing inside the application which
reduces developer productivity, is error prone, and slow due to
lack of optimization. Titan:db exposes a property graph data
model directly atop Cassandra which makes storing and
querying relationship data fast, easy, and scalable to huge
graphs. This talk demonstrates how Titan's features enable
complex, multi-relational databases in Cassandra and discusses
customer use cases for recommendation and personalization
engines.
Multi-Relational Data
Structure
Graph
Titan = Cassandra + Graph
Titan 0.5
Cassandra
,CH?;L M=;F;<CFCNS
@;OFN NIF?L;H=?
IJ?H
MIOL=?
GOFNC >;N;=?HN?L
BCAB J?L@ILG;H=?
Key	
   ColumnA	
   ColumnB	
   ColumnC	
   ColumnD	
   ColumnE	
   ColumnF	
  
username	
   email	
   password	
  
ma7	
   ma7@	
   12345	
  
john	
   john@	
   qwerty	
  
billy	
   billy@	
   abcde	
  
producDd	
   name	
   price	
  
52235	
   cup	
   12.55	
  
42215	
   spoon	
   7.22	
  
24529	
   knife	
   5.32	
  
User
 Product
CREATE INDEX ON User.username, User.email, Product.productid
CREATE INDEX ON username(User), email(User), productid(Product)
User
 Product
productid: 52235
name: cup
price: 12.55
username: matt
email: matt@
password: 12345
username	
   producDd	
   Dme	
  
ma7	
   52235	
   9/5/14	
  
billy	
   42215	
   8/7/14	
  
billy	
   42215	
   8/7/14	
  
Buy
username	
   email	
   password	
  
ma7	
   ma7@	
   12345	
  
john	
   john@	
   qwerty	
  
billy	
   billy@	
   abcde	
  
producDd	
   name	
   price	
  
52235	
   cup	
   12.55	
  
42215	
   spoon	
   7.22	
  
24529	
   knife	
   5.32	
  
User
 Product
productid: 52235
name: cup
price: 12.55
username: matt
email: matt@
password: 12345
buy
time: 9/5/14
What did ‘matt’ buy?
 Application level join
username	
   producDd	
   Dme	
  
ma7	
   52235	
   9/5/14	
  
billy	
   42215	
   8/7/14	
  
billy	
   42215	
   8/7/14	
  
Buy
username	
   email	
   password	
  
ma7	
   ma7@	
   12345	
  
john	
   john@	
   qwerty	
  
billy	
   billy@	
   abcde	
  
producDd	
   name	
   price	
  
52235	
   cup	
   12.55	
  
42215	
   spoon	
   7.22	
  
24529	
   knife	
   5.32	
  
What did ‘matt’ buy?
 g.V.has(‘username’,’matt’)
.out(‘buy’)
User
 Product
productid: 52235
name: cup
price: 12.55
username: matt
email: matt@
password: 12345
buy
time: 9/5/14
What did ‘matt’ recently
buy?
Application level join
username	
   producDd	
   Dme	
  
ma7	
   52235	
   9/5/14	
  
billy	
   42215	
   8/7/14	
  
billy	
   42215	
   8/7/14	
  
Buy
username	
   email	
   password	
  
ma7	
   ma7@	
   12345	
  
john	
   john@	
   qwerty	
  
billy	
   billy@	
   abcde	
  
producDd	
   name	
   price	
  
52235	
   cup	
   12.55	
  
42215	
   spoon	
   7.22	
  
24529	
   knife	
   5.32	
  
g.V.has(‘username’,’matt’)
.outE(‘buy’).orderBy(‘time’,DESC)
[0..9].inV
What did ‘matt’ recently
buy?
User
 Product
productid: 52235
name: cup
price: 12.55
username: matt
email: matt@
password: 12345
buy
time: 9/5/14
What did ‘matt’ recently
buy?
slow
User
 Product
productid: 52235
name: cup
price: 12.55
username: matt
email: matt@
password: 12345
buy
time: 9/5/14
g.V.has(‘username’,’matt’)
.outE(‘buy’).orderBy(‘time’,DESC)
[0..9].inV
username	
   producDd	
   Dme	
  
ma7	
   52235	
   9/5/14	
  
billy	
   42215	
   8/7/14	
  
billy	
   42215	
   8/7/14	
  
What did ‘matt’ recently
buy?
Rewrite join logic
username	
   Dme	
   producDd	
  
ma7	
   9/5/14	
   52235	
  
billy	
   8/7/14	
   42215	
  
billy	
   8/7/14	
   42215	
  
username	
   email	
   password	
  
ma7	
   ma7@	
   12345	
  
john	
   john@	
   qwerty	
  
billy	
   billy@	
   abcde	
  
producDd	
   name	
   price	
  
52235	
   cup	
   12.55	
  
42215	
   spoon	
   7.22	
  
24529	
   knife	
   5.32	
  
User
 Product
productid: 52235
name: cup
price: 12.55
username: matt
email: matt@
password: 12345
buy
time: 9/5/14
What did ‘matt’ recently
buy?
CREATE INDEX ON buy edges by time OUT direction
g.V.has(‘username’,’matt’)
.outE(‘buy’).orderBy(‘time’,DESC)
[0..9].inV
producDd	
   username	
   Dme	
  
52235	
   ma7	
   9/5/14	
  
42215	
   billy	
   8/7/14	
  
42215	
   billy	
   8/7/14	
  
Who bought ‘52235’?
 More application joins
producDd	
   Dme	
   producDd	
  
52235	
   9/5/14	
   ma7	
  
42215	
   8/7/14	
   billy	
  
42215	
   8/7/14	
   billy	
  
username	
   email	
   password	
  
ma7	
   ma7@	
   12345	
  
john	
   john@	
   qwerty	
  
billy	
   billy@	
   abcde	
  
producDd	
   name	
   price	
  
52235	
   cup	
   12.55	
  
42215	
   spoon	
   7.22	
  
24529	
   knife	
   5.32	
  
User
 Product
productid: 52235
name: cup
price: 12.55
username: matt
email: matt@
password: 12345
buy
time: 9/5/14
g.V.has(‘productid’,52235)
.in(‘buy’)
CREATE INDEX ON buy edges by time IN direction
Who bought ‘52235’?
Product join tables won’t scale
username	
   producDd	
   Dme	
   username	
   Dme	
   producDd	
  
username	
   email	
   password	
  
ma7	
   ma7@	
   12345	
  
john	
   john@	
   qwerty	
  
billy	
   billy@	
   abcde	
  
producDd	
   name	
   price	
  
52235	
   cup	
   12.55	
  
42215	
   spoon	
   7.22	
  
24529	
   knife	
   5.32	
  
producDd	
   username	
   Dme	
  
52235	
   ma7	
   9/5/14	
  
42215	
   billy	
   8/7/14	
  
42215	
   billy	
   8/7/14	
  
producDd	
   Dme	
   producDd	
  
52235	
   9/5/14	
   ma7	
  
42215	
   8/7/14	
   billy	
  
42215	
   8/7/14	
   billy	
  
User
 Product
productid: 52235
name: cup
price: 12.55
username: matt
email: matt@
password: 12345
buy
time: 9/5/14
PARTITION Product Vertices
Token Ring
(BOP)
Edge Cut
- assigns ids to map
vertices into “optimal”
token range
- Maintains virtual partitions
Vertex Cut
Combined Graph Partitioning
Database
Datastore
Transactions
v = g.V.has(‘username’,’matt’)
.has(‘password’,’12345’)
p = g.V.has(‘productid’,52235)
e = v.addEdge(‘buy’,p)
e.setProperty(‘time’,’9/11/2014’)
o = g.addVertex([orderid:242343])
o.addEdge(‘buyer’,v)
o.addEdge(‘product’,p)
g.commit()
unit of work
Atomicity
Consistency
Isolation
Durability
Transaction Consistency
u = g.addVertex([username:’matt’])
p = g.V.has(‘username’,’senior’)
u.addEdge(‘father’,p)
p.setProperty(‘surname’,’Jones’)
g.commit()
Locks acquired to ensure
consistency constraints are
enforced
•  Index Uniqueness
•  Multiplicity Constraints
•  Cardinality Constraints
Polyglot Data Architecture
© Jay Kreps @ LinkedIn
Transaction
modifications
logged
Consumers
Titan Event Framework
Use Cases
http://arli.us/magazinaluiza
Security
Fraud
http://arli.us/cisco-sec1
© Sean York @ Pearson Education
http://bit.ly/
WPTitanSEAGraph
http://arli.us/musicgraphintro
Music Graph
Knowledge Graph
TitanDB.io
Relationships + Cassandra
AURELIUS
THINKAURELIUS.COM

More Related Content

Similar to Cassandra Summit 2014: TitanDB - Scaling Relationship Data and Analysis with Cassandra

JSON Data Modeling in Document Database
JSON Data Modeling in Document DatabaseJSON Data Modeling in Document Database
JSON Data Modeling in Document DatabaseDATAVERSITY
 
Json data modeling june 2017 - pittsburgh tech fest
Json data modeling   june 2017 - pittsburgh tech festJson data modeling   june 2017 - pittsburgh tech fest
Json data modeling june 2017 - pittsburgh tech festMatthew Groves
 
Freeing Yourself from an RDBMS Architecture
Freeing Yourself from an RDBMS ArchitectureFreeing Yourself from an RDBMS Architecture
Freeing Yourself from an RDBMS ArchitectureDavid Hoerster
 
Microsoft_achievements_vijaymohire
Microsoft_achievements_vijaymohireMicrosoft_achievements_vijaymohire
Microsoft_achievements_vijaymohireVijayananda Mohire
 
Metadata Rules Folders Drool
Metadata Rules Folders DroolMetadata Rules Folders Drool
Metadata Rules Folders DroolTamara Bredemus
 
Titan: Scaling Graphs and TinkerPop3
Titan: Scaling Graphs and TinkerPop3Titan: Scaling Graphs and TinkerPop3
Titan: Scaling Graphs and TinkerPop3Matthias Broecheler
 
A Little Graph Theory for the Busy Developer - Jim Webber @ GraphConnect Chic...
A Little Graph Theory for the Busy Developer - Jim Webber @ GraphConnect Chic...A Little Graph Theory for the Busy Developer - Jim Webber @ GraphConnect Chic...
A Little Graph Theory for the Busy Developer - Jim Webber @ GraphConnect Chic...Neo4j
 
JSON Data Modeling - GDG Indy - April 2020
JSON Data Modeling - GDG Indy - April 2020JSON Data Modeling - GDG Indy - April 2020
JSON Data Modeling - GDG Indy - April 2020Matthew Groves
 
CALENDAR CARTOGRAPHY V1, V2, V3.pdf
CALENDAR CARTOGRAPHY V1, V2, V3.pdfCALENDAR CARTOGRAPHY V1, V2, V3.pdf
CALENDAR CARTOGRAPHY V1, V2, V3.pdfBrij Consulting, LLC
 
Intermediate Cypher.pdf
Intermediate Cypher.pdfIntermediate Cypher.pdf
Intermediate Cypher.pdfNeo4j
 

Similar to Cassandra Summit 2014: TitanDB - Scaling Relationship Data and Analysis with Cassandra (11)

JSON Data Modeling in Document Database
JSON Data Modeling in Document DatabaseJSON Data Modeling in Document Database
JSON Data Modeling in Document Database
 
Json data modeling june 2017 - pittsburgh tech fest
Json data modeling   june 2017 - pittsburgh tech festJson data modeling   june 2017 - pittsburgh tech fest
Json data modeling june 2017 - pittsburgh tech fest
 
Freeing Yourself from an RDBMS Architecture
Freeing Yourself from an RDBMS ArchitectureFreeing Yourself from an RDBMS Architecture
Freeing Yourself from an RDBMS Architecture
 
Microsoft_achievements_vijaymohire
Microsoft_achievements_vijaymohireMicrosoft_achievements_vijaymohire
Microsoft_achievements_vijaymohire
 
Metadata Rules Folders Drool
Metadata Rules Folders DroolMetadata Rules Folders Drool
Metadata Rules Folders Drool
 
Titan: Scaling Graphs and TinkerPop3
Titan: Scaling Graphs and TinkerPop3Titan: Scaling Graphs and TinkerPop3
Titan: Scaling Graphs and TinkerPop3
 
A Little Graph Theory for the Busy Developer - Jim Webber @ GraphConnect Chic...
A Little Graph Theory for the Busy Developer - Jim Webber @ GraphConnect Chic...A Little Graph Theory for the Busy Developer - Jim Webber @ GraphConnect Chic...
A Little Graph Theory for the Busy Developer - Jim Webber @ GraphConnect Chic...
 
Asid Presentation
Asid PresentationAsid Presentation
Asid Presentation
 
JSON Data Modeling - GDG Indy - April 2020
JSON Data Modeling - GDG Indy - April 2020JSON Data Modeling - GDG Indy - April 2020
JSON Data Modeling - GDG Indy - April 2020
 
CALENDAR CARTOGRAPHY V1, V2, V3.pdf
CALENDAR CARTOGRAPHY V1, V2, V3.pdfCALENDAR CARTOGRAPHY V1, V2, V3.pdf
CALENDAR CARTOGRAPHY V1, V2, V3.pdf
 
Intermediate Cypher.pdf
Intermediate Cypher.pdfIntermediate Cypher.pdf
Intermediate Cypher.pdf
 

More from DataStax Academy

Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
Forrester CXNYC 2017 - Delivering great real-time cx is a true craftForrester CXNYC 2017 - Delivering great real-time cx is a true craft
Forrester CXNYC 2017 - Delivering great real-time cx is a true craftDataStax Academy
 
Introduction to DataStax Enterprise Graph Database
Introduction to DataStax Enterprise Graph DatabaseIntroduction to DataStax Enterprise Graph Database
Introduction to DataStax Enterprise Graph DatabaseDataStax Academy
 
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache CassandraIntroduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache CassandraDataStax Academy
 
Cassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart LabsCassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart LabsDataStax Academy
 
Cassandra 3.0 Data Modeling
Cassandra 3.0 Data ModelingCassandra 3.0 Data Modeling
Cassandra 3.0 Data ModelingDataStax Academy
 
Cassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stackCassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stackDataStax Academy
 
Data Modeling for Apache Cassandra
Data Modeling for Apache CassandraData Modeling for Apache Cassandra
Data Modeling for Apache CassandraDataStax Academy
 
Production Ready Cassandra
Production Ready CassandraProduction Ready Cassandra
Production Ready CassandraDataStax Academy
 
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonCassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonDataStax Academy
 
Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1DataStax Academy
 
Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2DataStax Academy
 
Standing Up Your First Cluster
Standing Up Your First ClusterStanding Up Your First Cluster
Standing Up Your First ClusterDataStax Academy
 
Real Time Analytics with Dse
Real Time Analytics with DseReal Time Analytics with Dse
Real Time Analytics with DseDataStax Academy
 
Introduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache CassandraIntroduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache CassandraDataStax Academy
 
Enabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseEnabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseDataStax Academy
 
Advanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraAdvanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraDataStax Academy
 

More from DataStax Academy (20)

Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
Forrester CXNYC 2017 - Delivering great real-time cx is a true craftForrester CXNYC 2017 - Delivering great real-time cx is a true craft
Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
 
Introduction to DataStax Enterprise Graph Database
Introduction to DataStax Enterprise Graph DatabaseIntroduction to DataStax Enterprise Graph Database
Introduction to DataStax Enterprise Graph Database
 
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache CassandraIntroduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
 
Cassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart LabsCassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart Labs
 
Cassandra 3.0 Data Modeling
Cassandra 3.0 Data ModelingCassandra 3.0 Data Modeling
Cassandra 3.0 Data Modeling
 
Cassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stackCassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stack
 
Data Modeling for Apache Cassandra
Data Modeling for Apache CassandraData Modeling for Apache Cassandra
Data Modeling for Apache Cassandra
 
Coursera Cassandra Driver
Coursera Cassandra DriverCoursera Cassandra Driver
Coursera Cassandra Driver
 
Production Ready Cassandra
Production Ready CassandraProduction Ready Cassandra
Production Ready Cassandra
 
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonCassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
 
Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1
 
Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2
 
Standing Up Your First Cluster
Standing Up Your First ClusterStanding Up Your First Cluster
Standing Up Your First Cluster
 
Real Time Analytics with Dse
Real Time Analytics with DseReal Time Analytics with Dse
Real Time Analytics with Dse
 
Introduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache CassandraIntroduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache Cassandra
 
Cassandra Core Concepts
Cassandra Core ConceptsCassandra Core Concepts
Cassandra Core Concepts
 
Enabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseEnabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax Enterprise
 
Bad Habits Die Hard
Bad Habits Die Hard Bad Habits Die Hard
Bad Habits Die Hard
 
Advanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraAdvanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache Cassandra
 
Advanced Cassandra
Advanced CassandraAdvanced Cassandra
Advanced Cassandra
 

Recently uploaded

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Recently uploaded (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Cassandra Summit 2014: TitanDB - Scaling Relationship Data and Analysis with Cassandra

  • 1. AURELIUS THINKAURELIUS.COM Titan:db Scaling Relationship Data with C* Matthias Broecheler @mbroecheler September XI, MMXIV #CassandraSummit
  • 2. Storing relationship data in Cassandra entails data denormalization or pointer chasing inside the application which reduces developer productivity, is error prone, and slow due to lack of optimization. Titan:db exposes a property graph data model directly atop Cassandra which makes storing and querying relationship data fast, easy, and scalable to huge graphs. This talk demonstrates how Titan's features enable complex, multi-relational databases in Cassandra and discusses customer use cases for recommendation and personalization engines.
  • 7. Key   ColumnA   ColumnB   ColumnC   ColumnD   ColumnE   ColumnF  
  • 8.
  • 9. username   email   password   ma7   ma7@   12345   john   john@   qwerty   billy   billy@   abcde   producDd   name   price   52235   cup   12.55   42215   spoon   7.22   24529   knife   5.32   User Product CREATE INDEX ON User.username, User.email, Product.productid
  • 10. CREATE INDEX ON username(User), email(User), productid(Product) User Product productid: 52235 name: cup price: 12.55 username: matt email: matt@ password: 12345
  • 11. username   producDd   Dme   ma7   52235   9/5/14   billy   42215   8/7/14   billy   42215   8/7/14   Buy username   email   password   ma7   ma7@   12345   john   john@   qwerty   billy   billy@   abcde   producDd   name   price   52235   cup   12.55   42215   spoon   7.22   24529   knife   5.32  
  • 12. User Product productid: 52235 name: cup price: 12.55 username: matt email: matt@ password: 12345 buy time: 9/5/14
  • 13. What did ‘matt’ buy? Application level join username   producDd   Dme   ma7   52235   9/5/14   billy   42215   8/7/14   billy   42215   8/7/14   Buy username   email   password   ma7   ma7@   12345   john   john@   qwerty   billy   billy@   abcde   producDd   name   price   52235   cup   12.55   42215   spoon   7.22   24529   knife   5.32  
  • 14. What did ‘matt’ buy? g.V.has(‘username’,’matt’) .out(‘buy’) User Product productid: 52235 name: cup price: 12.55 username: matt email: matt@ password: 12345 buy time: 9/5/14
  • 15. What did ‘matt’ recently buy? Application level join username   producDd   Dme   ma7   52235   9/5/14   billy   42215   8/7/14   billy   42215   8/7/14   Buy username   email   password   ma7   ma7@   12345   john   john@   qwerty   billy   billy@   abcde   producDd   name   price   52235   cup   12.55   42215   spoon   7.22   24529   knife   5.32  
  • 16. g.V.has(‘username’,’matt’) .outE(‘buy’).orderBy(‘time’,DESC) [0..9].inV What did ‘matt’ recently buy? User Product productid: 52235 name: cup price: 12.55 username: matt email: matt@ password: 12345 buy time: 9/5/14
  • 17. What did ‘matt’ recently buy? slow User Product productid: 52235 name: cup price: 12.55 username: matt email: matt@ password: 12345 buy time: 9/5/14 g.V.has(‘username’,’matt’) .outE(‘buy’).orderBy(‘time’,DESC) [0..9].inV
  • 18. username   producDd   Dme   ma7   52235   9/5/14   billy   42215   8/7/14   billy   42215   8/7/14   What did ‘matt’ recently buy? Rewrite join logic username   Dme   producDd   ma7   9/5/14   52235   billy   8/7/14   42215   billy   8/7/14   42215   username   email   password   ma7   ma7@   12345   john   john@   qwerty   billy   billy@   abcde   producDd   name   price   52235   cup   12.55   42215   spoon   7.22   24529   knife   5.32  
  • 19. User Product productid: 52235 name: cup price: 12.55 username: matt email: matt@ password: 12345 buy time: 9/5/14 What did ‘matt’ recently buy? CREATE INDEX ON buy edges by time OUT direction g.V.has(‘username’,’matt’) .outE(‘buy’).orderBy(‘time’,DESC) [0..9].inV
  • 20. producDd   username   Dme   52235   ma7   9/5/14   42215   billy   8/7/14   42215   billy   8/7/14   Who bought ‘52235’? More application joins producDd   Dme   producDd   52235   9/5/14   ma7   42215   8/7/14   billy   42215   8/7/14   billy   username   email   password   ma7   ma7@   12345   john   john@   qwerty   billy   billy@   abcde   producDd   name   price   52235   cup   12.55   42215   spoon   7.22   24529   knife   5.32  
  • 21. User Product productid: 52235 name: cup price: 12.55 username: matt email: matt@ password: 12345 buy time: 9/5/14 g.V.has(‘productid’,52235) .in(‘buy’) CREATE INDEX ON buy edges by time IN direction Who bought ‘52235’?
  • 22. Product join tables won’t scale username   producDd   Dme   username   Dme   producDd   username   email   password   ma7   ma7@   12345   john   john@   qwerty   billy   billy@   abcde   producDd   name   price   52235   cup   12.55   42215   spoon   7.22   24529   knife   5.32   producDd   username   Dme   52235   ma7   9/5/14   42215   billy   8/7/14   42215   billy   8/7/14   producDd   Dme   producDd   52235   9/5/14   ma7   42215   8/7/14   billy   42215   8/7/14   billy  
  • 23. User Product productid: 52235 name: cup price: 12.55 username: matt email: matt@ password: 12345 buy time: 9/5/14 PARTITION Product Vertices
  • 24. Token Ring (BOP) Edge Cut - assigns ids to map vertices into “optimal” token range - Maintains virtual partitions
  • 28. Transactions v = g.V.has(‘username’,’matt’) .has(‘password’,’12345’) p = g.V.has(‘productid’,52235) e = v.addEdge(‘buy’,p) e.setProperty(‘time’,’9/11/2014’) o = g.addVertex([orderid:242343]) o.addEdge(‘buyer’,v) o.addEdge(‘product’,p) g.commit() unit of work Atomicity Consistency Isolation Durability
  • 29. Transaction Consistency u = g.addVertex([username:’matt’]) p = g.V.has(‘username’,’senior’) u.addEdge(‘father’,p) p.setProperty(‘surname’,’Jones’) g.commit() Locks acquired to ensure consistency constraints are enforced •  Index Uniqueness •  Multiplicity Constraints •  Cardinality Constraints
  • 30. Polyglot Data Architecture © Jay Kreps @ LinkedIn
  • 35. © Sean York @ Pearson Education