SlideShare a Scribd company logo
1 of 26
Download to read offline
Application Modeling with Graph
Databases – Relationships are cool!
Lars Martin, JUG Saxony Day, 04.04.2014
Application Modeling with Graph Databases – Relationships are cool!
§  Developer, Architect,
Consultant
§  Java Enterprise, Eclipse,
Continuous …
§  Entrepreneur since 1998
Who’s the guy?
Agenda
² Status Quo
² SQL Join Hell
² Graph Basics
² Application Modeling
Application Modeling with Graph Databases – Relationships are cool!
Application Modeling with Graph Databases – Relationships are cool!
Status Quo
http://db-engines.com/en/ranking_definition
Application Modeling with Graph Databases – Relationships are cool!
SQL Join Hell(1)
Customer
Id Name Address
1Robert 3
2Lars 7
3Michael 23
Address
Id Location
3Berlin
4Munich
7Dresden
23Leipzig
CustomerAddress
CId AId
1 3
2 7
2 8
3 23
Address
Id Location
3Berlin
7Dresden
8New York
23Leipzig
Address
Id Customer Location
3 1Berlin
7 2Dresden
8 2New York
23 3Leipzig
Customer
Id Name
1Robert
2Lars
3Michael
1:1 Relationship
m:n Relationship
1:n Relationship
Customer
Id Name
1Robert
2Lars
3Michael
Application Modeling with Graph Databases – Relationships are cool!
SQL Join Hell(2)
Application Modeling with Graph Databases – Relationships are cool!
SQL Join Hell(3)
­ all JOINs are executed every time you query (traverse)
the relationship
­ executing a JOIN means to search for a key in another
table
­ with Indices executing a JOIN means to lookup a key
­ B-Tree Index: O(log(n))
­ more entries è more lookups è slower JOINs
Application Modeling with Graph Databases – Relationships are cool!
Graphs – a Crash Course in Coolness
G = (V, E)Graph
Vertex
Edgeh"p://de.wikipedia.org/wiki/Graph_(Graphentheorie)	
  
Application Modeling with Graph Databases – Relationships are cool!
Graphs – a Crash Course in Coolness
Application Modeling with Graph Databases – Relationships are cool!
Graphs – a Crash Course in Coolness
Vertices
•  unique identifier
•  outgoing edges
•  incoming edges
•  key/value pairs
Edges
•  unique identifier
•  start vertex
•  end vertex
•  type
•  key/value pairs
https://github.com/tinkerpop/gremlin/wiki/Defining-a-Property-Graph
index-free adjacency (≈ O(1))
Application Modeling with Graph Databases – Relationships are cool!
Real World Graphs (1)
maps closely
to the data
model
noun = vertex
verb = edge
Application Modeling with Graph Databases – Relationships are cool!
Real World Graphs (2)
“whiteboard” friendly
Application Modeling with Graph Databases – Relationships are cool!
Ø  Social: Facebook, Twitter, LinkedIn
Ø  Recommendations: Amazon, MovieDB
Ø  Logistics: Package Routing
Ø  Financial: Fraud Detection
Ø  Software: Dependency Management
Ø  Authorization & Access Control:
Ø  …
Real World Graphs (3)
Application Modeling with Graph Databases – Relationships are cool!
Ø  Social: Facebook, Twitter, LinkedIn
Ø  Recommendations: Amazon, MovieDB
Ø  Logistics: Package Routing
Ø  Financial: Fraud Detection
Ø  Software: Dependency Management
Ø  Authorization & Access Control:
Ø  …
Real World Graphs (3)
our area of
activities
Application Modeling with Graph Databases – Relationships are cool!
Application Modeling
Spring Data – projects.spring.io/spring-data
ü  Spring Data Neo4j supports property graph features
XO - eXtended Objects – github.com/buschmais/xo
ü  Lightweight Datastore-agnostic ORM
ü  Implementation of “Composite Pattern”
ü  Interface based (no POJOS), multiple inheritance
ü  XO-Neo4j supports property graph features
Application Modeling with Graph Databases – Relationships are cool!
Application Modeling
Application Modeling with Graph Databases – Relationships are cool!
Application Modeling
@Label	
public interface User {	
	
@Indexed(unique = true)	
String getName();	
void setName(String name);	
	
@Relation("POSTED")	
@Outgoing	
Set<Tweet> getTweets();	
	
@Relation("FOLLOWS")	
@Outgoing	
Set<User> getFollowing();	
	
}	
@Label	
public interface Tweet {	
	
@Indexed(unique = true)	
long getTweetId();	
void setTweetId(long id);	
	
String getText();	
void setText(String text);	
	
@Relation("POSTED")	
@Incoming	
User getSender();	
void setSender(User sender);	
	
@Relation("MENTIONED")	
@Outgoing	
Set<User> getMentions();	
	…	
}
MATCH	
	(me)-[:POSTED]->(tweet)-[:MENTIONED]->(user)	
WHERE	
	me.name = 'Neo4j’ AND NOT (me)-[:FOLLOWS]->(user)	
WITH	
	user ORDER BY user.name	
RETURN	
	DISTINCT user	
  
Application Modeling with Graph Databases – Relationships are cool!
Application Modeling
@ResultOf	
@Cypher("MATCH (me)-[:POSTED]->(tweet)-
[:MENTIONED]->(user) WHERE id(me) = id({this})
AND NOT (me)-[:FOLLOWS]->(user) WITH user
ORDER BY user.name RETURN DISTINCT user")	
Result<User> suggestFriends();	
  
Demo
Application Modeling with Graph Databases – Relationships are cool!
Application Modeling
Relational Database
•  tabular data structures
Graph Database
•  connected data, esp.
multiple degrees
•  schema-less
Application Modeling with Graph Databases – Relationships are cool!
Application Modeling
“A relational database
may tell you the average
age of everyone in this
place …
… but a graph database
will tell you who is most
likely to buy you a beer.”
SMB GmbH – Plauenscher Ring 21 – D-01187 Dresden
Dipl.-Inf. Lars Martin
+49-(0)173-64 24 461
lars.martin@smb-tec.com
Application Modeling with Graph Databases - Relationships are cool

More Related Content

What's hot

Challenges in the Design of a Graph Database Benchmark
Challenges in the Design of a Graph Database Benchmark Challenges in the Design of a Graph Database Benchmark
Challenges in the Design of a Graph Database Benchmark
graphdevroom
 
Graph All the Things: An Introduction to Graph Databases
Graph All the Things: An Introduction to Graph DatabasesGraph All the Things: An Introduction to Graph Databases
Graph All the Things: An Introduction to Graph Databases
Neo4j
 
Graph Realities
Graph RealitiesGraph Realities
Graph Realities
Connected Data World
 
The years of the graph: The future of the future is here
The years of the graph: The future of the future is hereThe years of the graph: The future of the future is here
The years of the graph: The future of the future is here
Connected Data World
 
RAPIDS cuGraph – Accelerating all your Graph needs
RAPIDS cuGraph – Accelerating all your Graph needsRAPIDS cuGraph – Accelerating all your Graph needs
RAPIDS cuGraph – Accelerating all your Graph needs
Connected Data World
 

What's hot (20)

Creating a Data Distribution Knowledge Base using Neo4j, UBS
Creating a Data Distribution Knowledge Base using Neo4j, UBSCreating a Data Distribution Knowledge Base using Neo4j, UBS
Creating a Data Distribution Knowledge Base using Neo4j, UBS
 
Challenges in the Design of a Graph Database Benchmark
Challenges in the Design of a Graph Database Benchmark Challenges in the Design of a Graph Database Benchmark
Challenges in the Design of a Graph Database Benchmark
 
Graphs & Big Data - Philip Rathle and Andreas Kollegger @ Big Data Science Me...
Graphs & Big Data - Philip Rathle and Andreas Kollegger @ Big Data Science Me...Graphs & Big Data - Philip Rathle and Andreas Kollegger @ Big Data Science Me...
Graphs & Big Data - Philip Rathle and Andreas Kollegger @ Big Data Science Me...
 
Graph All the Things: An Introduction to Graph Databases
Graph All the Things: An Introduction to Graph DatabasesGraph All the Things: An Introduction to Graph Databases
Graph All the Things: An Introduction to Graph Databases
 
The Total Economic ImpactTM (TEI) of Neo4j, Featuring Forrester
The Total Economic ImpactTM (TEI) of Neo4j, Featuring ForresterThe Total Economic ImpactTM (TEI) of Neo4j, Featuring Forrester
The Total Economic ImpactTM (TEI) of Neo4j, Featuring Forrester
 
Graph Networks for Object Recognition
Graph Networks for Object RecognitionGraph Networks for Object Recognition
Graph Networks for Object Recognition
 
GraphConnect SF 2013 Keynote
GraphConnect SF 2013 KeynoteGraphConnect SF 2013 Keynote
GraphConnect SF 2013 Keynote
 
Graph Realities
Graph RealitiesGraph Realities
Graph Realities
 
The years of the graph: The future of the future is here
The years of the graph: The future of the future is hereThe years of the graph: The future of the future is here
The years of the graph: The future of the future is here
 
Towards Automating Data Narratives
Towards Automating Data NarrativesTowards Automating Data Narratives
Towards Automating Data Narratives
 
Multiplatform solution for graph datasources
Multiplatform solution for graph datasourcesMultiplatform solution for graph datasources
Multiplatform solution for graph datasources
 
(Big) Data Science
(Big) Data Science(Big) Data Science
(Big) Data Science
 
Graph based data models
Graph based data modelsGraph based data models
Graph based data models
 
Unveiling the knowledge in knowledge graphs
Unveiling the knowledge in knowledge graphsUnveiling the knowledge in knowledge graphs
Unveiling the knowledge in knowledge graphs
 
DN18 | From Counting to Connecting: A Networked and Data-Driven Approach to M...
DN18 | From Counting to Connecting: A Networked and Data-Driven Approach to M...DN18 | From Counting to Connecting: A Networked and Data-Driven Approach to M...
DN18 | From Counting to Connecting: A Networked and Data-Driven Approach to M...
 
Extracting, Aligning, and Linking Data to Build Knowledge Graphs
Extracting, Aligning, and Linking Data to Build Knowledge GraphsExtracting, Aligning, and Linking Data to Build Knowledge Graphs
Extracting, Aligning, and Linking Data to Build Knowledge Graphs
 
Graph db
Graph dbGraph db
Graph db
 
Hardcore Data Science - in Practice
Hardcore Data Science - in PracticeHardcore Data Science - in Practice
Hardcore Data Science - in Practice
 
RAPIDS cuGraph – Accelerating all your Graph needs
RAPIDS cuGraph – Accelerating all your Graph needsRAPIDS cuGraph – Accelerating all your Graph needs
RAPIDS cuGraph – Accelerating all your Graph needs
 
Fireside Chat with Bloor Research: State of the Graph Database Market 2020
Fireside Chat with Bloor Research: State of the Graph Database Market 2020Fireside Chat with Bloor Research: State of the Graph Database Market 2020
Fireside Chat with Bloor Research: State of the Graph Database Market 2020
 

Viewers also liked

Intro to Graphs and Neo4j
Intro to Graphs and Neo4jIntro to Graphs and Neo4j
Intro to Graphs and Neo4j
jexp
 

Viewers also liked (20)

Shutl
ShutlShutl
Shutl
 
Exploring cypher with graph gists
Exploring cypher with graph gistsExploring cypher with graph gists
Exploring cypher with graph gists
 
Graph Databases, a little connected tour (Codemotion Rome)
Graph Databases, a little connected tour (Codemotion Rome)Graph Databases, a little connected tour (Codemotion Rome)
Graph Databases, a little connected tour (Codemotion Rome)
 
Intro to Graphs and Neo4j
Intro to Graphs and Neo4jIntro to Graphs and Neo4j
Intro to Graphs and Neo4j
 
The Five Graphs of Government: How Federal Agencies can Utilize Graph Technology
The Five Graphs of Government: How Federal Agencies can Utilize Graph TechnologyThe Five Graphs of Government: How Federal Agencies can Utilize Graph Technology
The Five Graphs of Government: How Federal Agencies can Utilize Graph Technology
 
GraphTalks Rome - Selecting the right Technology
GraphTalks Rome - Selecting the right TechnologyGraphTalks Rome - Selecting the right Technology
GraphTalks Rome - Selecting the right Technology
 
Intro to Neo4j presentation
Intro to Neo4j presentationIntro to Neo4j presentation
Intro to Neo4j presentation
 
GraphTalks Rome - Introducing Neo4j
GraphTalks Rome - Introducing Neo4jGraphTalks Rome - Introducing Neo4j
GraphTalks Rome - Introducing Neo4j
 
GraphTalks Rome - Identity and Access Management
GraphTalks Rome - Identity and Access ManagementGraphTalks Rome - Identity and Access Management
GraphTalks Rome - Identity and Access Management
 
GraphTalks Rome - The Italian Business Graph
GraphTalks Rome - The Italian Business GraphGraphTalks Rome - The Italian Business Graph
GraphTalks Rome - The Italian Business Graph
 
Knowledge Architecture: Graphing Your Knowledge
Knowledge Architecture: Graphing Your KnowledgeKnowledge Architecture: Graphing Your Knowledge
Knowledge Architecture: Graphing Your Knowledge
 
Webinar: RDBMS to Graphs
Webinar: RDBMS to GraphsWebinar: RDBMS to Graphs
Webinar: RDBMS to Graphs
 
IT in Healthcare
IT in HealthcareIT in Healthcare
IT in Healthcare
 
Dear NSA, let me take care of your slides.
Dear NSA, let me take care of your slides.Dear NSA, let me take care of your slides.
Dear NSA, let me take care of your slides.
 
What I Carry: 10 Tools for Success
What I Carry: 10 Tools for SuccessWhat I Carry: 10 Tools for Success
What I Carry: 10 Tools for Success
 
Visualization of Publication Impact
Visualization of Publication ImpactVisualization of Publication Impact
Visualization of Publication Impact
 
GraphDay Stockholm - Levaraging Graph-Technology to fight Financial Fraud
GraphDay Stockholm - Levaraging Graph-Technology to fight Financial FraudGraphDay Stockholm - Levaraging Graph-Technology to fight Financial Fraud
GraphDay Stockholm - Levaraging Graph-Technology to fight Financial Fraud
 
GraphDay Stockholm - Graphs in Action
GraphDay Stockholm - Graphs in ActionGraphDay Stockholm - Graphs in Action
GraphDay Stockholm - Graphs in Action
 
GraphDay Stockholm - iKnow Solutions - The Value Add of Graphs to Analytics a...
GraphDay Stockholm - iKnow Solutions - The Value Add of Graphs to Analytics a...GraphDay Stockholm - iKnow Solutions - The Value Add of Graphs to Analytics a...
GraphDay Stockholm - iKnow Solutions - The Value Add of Graphs to Analytics a...
 
GraphDay Stockholm - Telia Zone
GraphDay Stockholm - Telia Zone GraphDay Stockholm - Telia Zone
GraphDay Stockholm - Telia Zone
 

Similar to Application Modeling with Graph Databases - Relationships are cool

La bi, l'informatique décisionnelle et les graphes
La bi, l'informatique décisionnelle et les graphesLa bi, l'informatique décisionnelle et les graphes
La bi, l'informatique décisionnelle et les graphes
Cédric Fauvet
 
The five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar finalThe five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar final
Neo4j
 
The five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar finalThe five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar final
Neo4j
 
The Semantic Knowledge Graph
The Semantic Knowledge GraphThe Semantic Knowledge Graph
The Semantic Knowledge Graph
Trey Grainger
 
TadHenryResume2016
TadHenryResume2016TadHenryResume2016
TadHenryResume2016
Tad Henry
 

Similar to Application Modeling with Graph Databases - Relationships are cool (20)

How Graph Databases used in Police Department?
How Graph Databases used in Police Department?How Graph Databases used in Police Department?
How Graph Databases used in Police Department?
 
La bi, l'informatique décisionnelle et les graphes
La bi, l'informatique décisionnelle et les graphesLa bi, l'informatique décisionnelle et les graphes
La bi, l'informatique décisionnelle et les graphes
 
Using A Distributed Graph Database To Make Sense Of Disparate Data Stores
Using A Distributed Graph Database To Make Sense Of Disparate Data StoresUsing A Distributed Graph Database To Make Sense Of Disparate Data Stores
Using A Distributed Graph Database To Make Sense Of Disparate Data Stores
 
Connecting the Dots—How a Graph Database Enables Discovery
Connecting the Dots—How a Graph Database Enables DiscoveryConnecting the Dots—How a Graph Database Enables Discovery
Connecting the Dots—How a Graph Database Enables Discovery
 
AI, ML and Graph Algorithms: Real Life Use Cases with Neo4j
AI, ML and Graph Algorithms: Real Life Use Cases with Neo4jAI, ML and Graph Algorithms: Real Life Use Cases with Neo4j
AI, ML and Graph Algorithms: Real Life Use Cases with Neo4j
 
The five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar finalThe five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar final
 
The five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar finalThe five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar final
 
Sample CS Senior Capstone Projects
Sample CS Senior Capstone ProjectsSample CS Senior Capstone Projects
Sample CS Senior Capstone Projects
 
Semantic Security : Authorization on the Web with Ontologies
Semantic Security : Authorization on the Web with OntologiesSemantic Security : Authorization on the Web with Ontologies
Semantic Security : Authorization on the Web with Ontologies
 
Resume_Vignesh_ThulasiDass
Resume_Vignesh_ThulasiDass Resume_Vignesh_ThulasiDass
Resume_Vignesh_ThulasiDass
 
Using Connected Data and Graph Technology to Enhance Machine Learning and Art...
Using Connected Data and Graph Technology to Enhance Machine Learning and Art...Using Connected Data and Graph Technology to Enhance Machine Learning and Art...
Using Connected Data and Graph Technology to Enhance Machine Learning and Art...
 
PykQuery.js
PykQuery.jsPykQuery.js
PykQuery.js
 
Pre-Aggregated Analytics And Social Feeds Using MongoDB
Pre-Aggregated Analytics And Social Feeds Using MongoDBPre-Aggregated Analytics And Social Feeds Using MongoDB
Pre-Aggregated Analytics And Social Feeds Using MongoDB
 
Geschäftliches Potential für System-Integratoren und Berater - Graphdatenban...
Geschäftliches Potential für System-Integratoren und Berater -  Graphdatenban...Geschäftliches Potential für System-Integratoren und Berater -  Graphdatenban...
Geschäftliches Potential für System-Integratoren und Berater - Graphdatenban...
 
The Semantic Knowledge Graph
The Semantic Knowledge GraphThe Semantic Knowledge Graph
The Semantic Knowledge Graph
 
TadHenryResume2016
TadHenryResume2016TadHenryResume2016
TadHenryResume2016
 
Neo4j : la voie du succès avec les bases de données de graphes et la Graph Da...
Neo4j : la voie du succès avec les bases de données de graphes et la Graph Da...Neo4j : la voie du succès avec les bases de données de graphes et la Graph Da...
Neo4j : la voie du succès avec les bases de données de graphes et la Graph Da...
 
K anonymity for crowdsourcing database
K anonymity for crowdsourcing databaseK anonymity for crowdsourcing database
K anonymity for crowdsourcing database
 
How to Build a Semantic Search System
How to Build a Semantic Search SystemHow to Build a Semantic Search System
How to Build a Semantic Search System
 
Turning Big Data into Smart Data with Graph Technologies
Turning Big Data into Smart Data with Graph TechnologiesTurning Big Data into Smart Data with Graph Technologies
Turning Big Data into Smart Data with Graph Technologies
 

More from Lars Martin

More from Lars Martin (7)

Skalierbares CI Deployment mit Docker
Skalierbares CI Deployment mit DockerSkalierbares CI Deployment mit Docker
Skalierbares CI Deployment mit Docker
 
Software Development in the Cloud
Software Development in the CloudSoftware Development in the Cloud
Software Development in the Cloud
 
Towards Clean Legacy Code
Towards Clean Legacy CodeTowards Clean Legacy Code
Towards Clean Legacy Code
 
smart3 - Smart Gardening für smarte Bürger in einer smarten City
smart3 - Smart Gardening für smarte Bürger in einer smarten Citysmart3 - Smart Gardening für smarte Bürger in einer smarten City
smart3 - Smart Gardening für smarte Bürger in einer smarten City
 
Software Archaeology - Raiders of the Lost Code (long)
Software Archaeology - Raiders of the Lost Code (long)Software Archaeology - Raiders of the Lost Code (long)
Software Archaeology - Raiders of the Lost Code (long)
 
Software Archaeology - Raiders of the Lost Code (short)
Software Archaeology - Raiders of the Lost Code (short)Software Archaeology - Raiders of the Lost Code (short)
Software Archaeology - Raiders of the Lost Code (short)
 
Formal Requirement Engineering with Xtext and ProR
Formal Requirement Engineering with Xtext and ProRFormal Requirement Engineering with Xtext and ProR
Formal Requirement Engineering with Xtext and ProR
 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Recently uploaded (20)

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 

Application Modeling with Graph Databases - Relationships are cool

  • 1. Application Modeling with Graph Databases – Relationships are cool! Lars Martin, JUG Saxony Day, 04.04.2014
  • 2. Application Modeling with Graph Databases – Relationships are cool! §  Developer, Architect, Consultant §  Java Enterprise, Eclipse, Continuous … §  Entrepreneur since 1998 Who’s the guy?
  • 3. Agenda ² Status Quo ² SQL Join Hell ² Graph Basics ² Application Modeling Application Modeling with Graph Databases – Relationships are cool!
  • 4. Application Modeling with Graph Databases – Relationships are cool! Status Quo http://db-engines.com/en/ranking_definition
  • 5. Application Modeling with Graph Databases – Relationships are cool! SQL Join Hell(1) Customer Id Name Address 1Robert 3 2Lars 7 3Michael 23 Address Id Location 3Berlin 4Munich 7Dresden 23Leipzig CustomerAddress CId AId 1 3 2 7 2 8 3 23 Address Id Location 3Berlin 7Dresden 8New York 23Leipzig Address Id Customer Location 3 1Berlin 7 2Dresden 8 2New York 23 3Leipzig Customer Id Name 1Robert 2Lars 3Michael 1:1 Relationship m:n Relationship 1:n Relationship Customer Id Name 1Robert 2Lars 3Michael
  • 6. Application Modeling with Graph Databases – Relationships are cool! SQL Join Hell(2)
  • 7. Application Modeling with Graph Databases – Relationships are cool! SQL Join Hell(3) ­ all JOINs are executed every time you query (traverse) the relationship ­ executing a JOIN means to search for a key in another table ­ with Indices executing a JOIN means to lookup a key ­ B-Tree Index: O(log(n)) ­ more entries è more lookups è slower JOINs
  • 8.
  • 9. Application Modeling with Graph Databases – Relationships are cool! Graphs – a Crash Course in Coolness G = (V, E)Graph Vertex Edgeh"p://de.wikipedia.org/wiki/Graph_(Graphentheorie)  
  • 10. Application Modeling with Graph Databases – Relationships are cool! Graphs – a Crash Course in Coolness
  • 11. Application Modeling with Graph Databases – Relationships are cool! Graphs – a Crash Course in Coolness Vertices •  unique identifier •  outgoing edges •  incoming edges •  key/value pairs Edges •  unique identifier •  start vertex •  end vertex •  type •  key/value pairs https://github.com/tinkerpop/gremlin/wiki/Defining-a-Property-Graph index-free adjacency (≈ O(1))
  • 12.
  • 13. Application Modeling with Graph Databases – Relationships are cool! Real World Graphs (1) maps closely to the data model noun = vertex verb = edge
  • 14. Application Modeling with Graph Databases – Relationships are cool! Real World Graphs (2) “whiteboard” friendly
  • 15. Application Modeling with Graph Databases – Relationships are cool! Ø  Social: Facebook, Twitter, LinkedIn Ø  Recommendations: Amazon, MovieDB Ø  Logistics: Package Routing Ø  Financial: Fraud Detection Ø  Software: Dependency Management Ø  Authorization & Access Control: Ø  … Real World Graphs (3)
  • 16. Application Modeling with Graph Databases – Relationships are cool! Ø  Social: Facebook, Twitter, LinkedIn Ø  Recommendations: Amazon, MovieDB Ø  Logistics: Package Routing Ø  Financial: Fraud Detection Ø  Software: Dependency Management Ø  Authorization & Access Control: Ø  … Real World Graphs (3) our area of activities
  • 17.
  • 18. Application Modeling with Graph Databases – Relationships are cool! Application Modeling Spring Data – projects.spring.io/spring-data ü  Spring Data Neo4j supports property graph features XO - eXtended Objects – github.com/buschmais/xo ü  Lightweight Datastore-agnostic ORM ü  Implementation of “Composite Pattern” ü  Interface based (no POJOS), multiple inheritance ü  XO-Neo4j supports property graph features
  • 19. Application Modeling with Graph Databases – Relationships are cool! Application Modeling
  • 20. Application Modeling with Graph Databases – Relationships are cool! Application Modeling @Label public interface User { @Indexed(unique = true) String getName(); void setName(String name); @Relation("POSTED") @Outgoing Set<Tweet> getTweets(); @Relation("FOLLOWS") @Outgoing Set<User> getFollowing(); } @Label public interface Tweet { @Indexed(unique = true) long getTweetId(); void setTweetId(long id); String getText(); void setText(String text); @Relation("POSTED") @Incoming User getSender(); void setSender(User sender); @Relation("MENTIONED") @Outgoing Set<User> getMentions(); … }
  • 21. MATCH (me)-[:POSTED]->(tweet)-[:MENTIONED]->(user) WHERE me.name = 'Neo4j’ AND NOT (me)-[:FOLLOWS]->(user) WITH user ORDER BY user.name RETURN DISTINCT user   Application Modeling with Graph Databases – Relationships are cool! Application Modeling @ResultOf @Cypher("MATCH (me)-[:POSTED]->(tweet)- [:MENTIONED]->(user) WHERE id(me) = id({this}) AND NOT (me)-[:FOLLOWS]->(user) WITH user ORDER BY user.name RETURN DISTINCT user") Result<User> suggestFriends();  
  • 22. Demo Application Modeling with Graph Databases – Relationships are cool! Application Modeling
  • 23. Relational Database •  tabular data structures Graph Database •  connected data, esp. multiple degrees •  schema-less Application Modeling with Graph Databases – Relationships are cool! Application Modeling “A relational database may tell you the average age of everyone in this place … … but a graph database will tell you who is most likely to buy you a beer.”
  • 24.
  • 25. SMB GmbH – Plauenscher Ring 21 – D-01187 Dresden Dipl.-Inf. Lars Martin +49-(0)173-64 24 461 lars.martin@smb-tec.com