SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Downloaden Sie, um offline zu lesen
GraphAware®
It Depends…
Luanne Misquitta

VP of Engineering
graphaware.com
@graph_aware, @luannem
and why it’s the most frequent answer to
graph modelling questions
The Data
GraphAware®
‣ Movies
‣ Actors
‣ Directors
‣ Roles
‣ Genres
Normalised
GraphAware®
Candidate Graph Model 1
GraphAware®
Person
name
ACTED_IN
DIRECTED
roles:[“role1”,”role2”] Movie

title

genre
Candidate Graph Model 2
GraphAware®
Person

name
Movie

title

ACTED_IN
DIRECTED
roles:[“role1”,”role2”]
Genre

name

HAS_GENRE
Candidate Graph Model 3
GraphAware®
Person

name
Movie

[Genre]

title

ACTED_IN
DIRECTED
roles:[“role1”,”role2”]
Candidate Graph Model 4
GraphAware®
Person

name
Movie

title

Genre

name

Role

name

HAS_GENRE
PLAYED_ROLE
ROLE
ROLE_IN_MOVIE
DIRECTED
GraphAware®
Don’t be afraid!
GraphAware®
‣ Graph modelling is an extremely useful exercise
‣ Validate your understanding of the problem on a whiteboard
‣ The way you naturally represent your domain on the whiteboard is generally
your graph model
‣ No normalisation rules required- all stakeholders can participate
‣ Expose gaps in thinking, missing data early
‣ This modelling is beneficial even if you’re not using a graph database
‣ But if you draw it as a graph, and think of it as a graph, you probably need a
graph database
A candidate model
GraphAware®
Person
name
ACTED_IN
DIRECTED
Movie

title
Now what?
GraphAware®
‣ Should role be
‣ a property on a relationship?
‣ a node?
Now what?
GraphAware®
‣ Should genre be
‣ a property on a node?
‣ a node?
‣ a label?
‣ both?
Now what?
GraphAware®
‣ Should…?
It depends!
GraphAware®
What is the question?
GraphAware®
‣ The use case or the question you’re asking of the graph will determine
the most suitable graph model to
‣ Answer the question
‣ Perform efficient queries
‣ Keep things simple- model just enough, but no more
‣ As a movie fan, I want to find a movie, and see actors and their roles
Use case #1
GraphAware®
‣ As a movie fan, I want to find a movie, and see actors and their roles
Use case #1
GraphAware®
Person

name
Movie

title

genre
ACTED_IN
DIRECTED
roles:[“role1”,”role2”]
‣ As a movie fan, I want to find movies in genres similar to my favourites
Use case #2
GraphAware®
‣ As a movie fan, I want to find movies in genres similar to my favourites
Use case #2
GraphAware®
Person

name
Movie

title

ACTED_IN
DIRECTED
roles:[“role1”,”role2”]
Genre

name

HAS_GENRE
Movie

title

Genre

name

ACTED_IN
HAS_GENRE
SIMILAR_TO
‣ As a movie fan, I want to find actors who played the role of Neo and the
awards they won for this role
Use case #3
GraphAware®
‣ As a movie fan, I want to find actors who played the role of Neo and the
awards they won for this role
Use case #3
GraphAware®
Person

name
Movie

title

DIRECTED
Genre

name

HAS_GENRE
Movie

title

Genre

name

ACTED_IN
HAS_GENRE
SIMILAR_TO
Role

name

<hyperedge>
Award

name

PLAYED_ROLE
AWARD_ROLE
ROLE
ROLE_IN_MOVIEYear
Summary
GraphAware®
‣ Know thy use case
‣ Keep it simple and intuitive
‣ Consider
‣ the shape and size of your data
‣ the density of relationships
‣ selectivity
‣ read vs write trade-offs
‣ Measure performance but…
‣ Do not prematurely optimise- graph model refactoring is easy!
Hunger Games
GraphAware®
1. Easy: To be able to model your graph well, you should know
A. Your use case
B. The weather
C. A list of hair-metal bands
2. Medium: Should I model this fact as a property of a node, or a node?
A. Property of a node
B. A node
C. It depends
3. Hard: Sometimes you need an edge that relates more than 2 nodes. What do
you do?
A. Use a relationship between two nodes, store the context as properties
B. Use a hyper edge
C. Model with multiple nodes but identify they belong together with a groupID


Answer at: r.neo4j.com/hunger-games
graphaware.com

@graph_aware

Weitere ähnliche Inhalte

Mehr von GraphAware

Unparalleled Graph Database Scalability Delivered by Neo4j 4.0
Unparalleled Graph Database Scalability Delivered by Neo4j 4.0Unparalleled Graph Database Scalability Delivered by Neo4j 4.0
Unparalleled Graph Database Scalability Delivered by Neo4j 4.0GraphAware
 
Challenges in knowledge graph visualization
Challenges in knowledge graph visualizationChallenges in knowledge graph visualization
Challenges in knowledge graph visualizationGraphAware
 
Social media monitoring with ML-powered Knowledge Graph
Social media monitoring with ML-powered Knowledge GraphSocial media monitoring with ML-powered Knowledge Graph
Social media monitoring with ML-powered Knowledge GraphGraphAware
 
To be or not to be.
To be or not to be. To be or not to be.
To be or not to be. GraphAware
 
How Boston Scientific Improves Manufacturing Quality Using Graph Analytics
How Boston Scientific Improves Manufacturing Quality Using Graph AnalyticsHow Boston Scientific Improves Manufacturing Quality Using Graph Analytics
How Boston Scientific Improves Manufacturing Quality Using Graph AnalyticsGraphAware
 
When privacy matters! Chatbots in data-sensitive businesses
When privacy matters! Chatbots in data-sensitive businessesWhen privacy matters! Chatbots in data-sensitive businesses
When privacy matters! Chatbots in data-sensitive businessesGraphAware
 
Graph-Powered Machine Learning
Graph-Powered Machine LearningGraph-Powered Machine Learning
Graph-Powered Machine LearningGraphAware
 
Signals from outer space
Signals from outer spaceSignals from outer space
Signals from outer spaceGraphAware
 
Neo4j-Databridge: Enterprise-scale ETL for Neo4j
Neo4j-Databridge: Enterprise-scale ETL for Neo4jNeo4j-Databridge: Enterprise-scale ETL for Neo4j
Neo4j-Databridge: Enterprise-scale ETL for Neo4jGraphAware
 
Graph-Powered Machine Learning
Graph-Powered Machine Learning Graph-Powered Machine Learning
Graph-Powered Machine Learning GraphAware
 
(Big) Data Science
 (Big) Data Science (Big) Data Science
(Big) Data ScienceGraphAware
 
Modelling Data in Neo4j (plus a few tips)
Modelling Data in Neo4j (plus a few tips)Modelling Data in Neo4j (plus a few tips)
Modelling Data in Neo4j (plus a few tips)GraphAware
 
Intro to Neo4j (CZ)
Intro to Neo4j (CZ)Intro to Neo4j (CZ)
Intro to Neo4j (CZ)GraphAware
 
Modelling Data as Graphs (Neo4j)
Modelling Data as Graphs (Neo4j)Modelling Data as Graphs (Neo4j)
Modelling Data as Graphs (Neo4j)GraphAware
 
GraphAware Framework Intro
GraphAware Framework IntroGraphAware Framework Intro
GraphAware Framework IntroGraphAware
 
Advanced Neo4j Use Cases with the GraphAware Framework
Advanced Neo4j Use Cases with the GraphAware FrameworkAdvanced Neo4j Use Cases with the GraphAware Framework
Advanced Neo4j Use Cases with the GraphAware FrameworkGraphAware
 
Recommendations with Neo4j (FOSDEM 2015)
Recommendations with Neo4j (FOSDEM 2015)Recommendations with Neo4j (FOSDEM 2015)
Recommendations with Neo4j (FOSDEM 2015)GraphAware
 
Machine Learning Powered by Graphs - Alessandro Negro
Machine Learning Powered by Graphs - Alessandro NegroMachine Learning Powered by Graphs - Alessandro Negro
Machine Learning Powered by Graphs - Alessandro NegroGraphAware
 
Knowledge Graphs and Chatbots with Neo4j and IBM Watson - Christophe Willemsen
Knowledge Graphs and Chatbots with Neo4j and IBM Watson - Christophe WillemsenKnowledge Graphs and Chatbots with Neo4j and IBM Watson - Christophe Willemsen
Knowledge Graphs and Chatbots with Neo4j and IBM Watson - Christophe WillemsenGraphAware
 
The power of polyglot searching
The power of polyglot searchingThe power of polyglot searching
The power of polyglot searchingGraphAware
 

Mehr von GraphAware (20)

Unparalleled Graph Database Scalability Delivered by Neo4j 4.0
Unparalleled Graph Database Scalability Delivered by Neo4j 4.0Unparalleled Graph Database Scalability Delivered by Neo4j 4.0
Unparalleled Graph Database Scalability Delivered by Neo4j 4.0
 
Challenges in knowledge graph visualization
Challenges in knowledge graph visualizationChallenges in knowledge graph visualization
Challenges in knowledge graph visualization
 
Social media monitoring with ML-powered Knowledge Graph
Social media monitoring with ML-powered Knowledge GraphSocial media monitoring with ML-powered Knowledge Graph
Social media monitoring with ML-powered Knowledge Graph
 
To be or not to be.
To be or not to be. To be or not to be.
To be or not to be.
 
How Boston Scientific Improves Manufacturing Quality Using Graph Analytics
How Boston Scientific Improves Manufacturing Quality Using Graph AnalyticsHow Boston Scientific Improves Manufacturing Quality Using Graph Analytics
How Boston Scientific Improves Manufacturing Quality Using Graph Analytics
 
When privacy matters! Chatbots in data-sensitive businesses
When privacy matters! Chatbots in data-sensitive businessesWhen privacy matters! Chatbots in data-sensitive businesses
When privacy matters! Chatbots in data-sensitive businesses
 
Graph-Powered Machine Learning
Graph-Powered Machine LearningGraph-Powered Machine Learning
Graph-Powered Machine Learning
 
Signals from outer space
Signals from outer spaceSignals from outer space
Signals from outer space
 
Neo4j-Databridge: Enterprise-scale ETL for Neo4j
Neo4j-Databridge: Enterprise-scale ETL for Neo4jNeo4j-Databridge: Enterprise-scale ETL for Neo4j
Neo4j-Databridge: Enterprise-scale ETL for Neo4j
 
Graph-Powered Machine Learning
Graph-Powered Machine Learning Graph-Powered Machine Learning
Graph-Powered Machine Learning
 
(Big) Data Science
 (Big) Data Science (Big) Data Science
(Big) Data Science
 
Modelling Data in Neo4j (plus a few tips)
Modelling Data in Neo4j (plus a few tips)Modelling Data in Neo4j (plus a few tips)
Modelling Data in Neo4j (plus a few tips)
 
Intro to Neo4j (CZ)
Intro to Neo4j (CZ)Intro to Neo4j (CZ)
Intro to Neo4j (CZ)
 
Modelling Data as Graphs (Neo4j)
Modelling Data as Graphs (Neo4j)Modelling Data as Graphs (Neo4j)
Modelling Data as Graphs (Neo4j)
 
GraphAware Framework Intro
GraphAware Framework IntroGraphAware Framework Intro
GraphAware Framework Intro
 
Advanced Neo4j Use Cases with the GraphAware Framework
Advanced Neo4j Use Cases with the GraphAware FrameworkAdvanced Neo4j Use Cases with the GraphAware Framework
Advanced Neo4j Use Cases with the GraphAware Framework
 
Recommendations with Neo4j (FOSDEM 2015)
Recommendations with Neo4j (FOSDEM 2015)Recommendations with Neo4j (FOSDEM 2015)
Recommendations with Neo4j (FOSDEM 2015)
 
Machine Learning Powered by Graphs - Alessandro Negro
Machine Learning Powered by Graphs - Alessandro NegroMachine Learning Powered by Graphs - Alessandro Negro
Machine Learning Powered by Graphs - Alessandro Negro
 
Knowledge Graphs and Chatbots with Neo4j and IBM Watson - Christophe Willemsen
Knowledge Graphs and Chatbots with Neo4j and IBM Watson - Christophe WillemsenKnowledge Graphs and Chatbots with Neo4j and IBM Watson - Christophe Willemsen
Knowledge Graphs and Chatbots with Neo4j and IBM Watson - Christophe Willemsen
 
The power of polyglot searching
The power of polyglot searchingThe power of polyglot searching
The power of polyglot searching
 

Kürzlich hochgeladen

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
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
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Kürzlich hochgeladen (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

It Depends (and why it's the most frequent answer to modelling questions)

  • 1. GraphAware® It Depends… Luanne Misquitta
 VP of Engineering graphaware.com @graph_aware, @luannem and why it’s the most frequent answer to graph modelling questions
  • 2. The Data GraphAware® ‣ Movies ‣ Actors ‣ Directors ‣ Roles ‣ Genres
  • 4. Candidate Graph Model 1 GraphAware® Person name ACTED_IN DIRECTED roles:[“role1”,”role2”] Movie
 title
 genre
  • 5. Candidate Graph Model 2 GraphAware® Person
 name Movie
 title
 ACTED_IN DIRECTED roles:[“role1”,”role2”] Genre
 name
 HAS_GENRE
  • 6. Candidate Graph Model 3 GraphAware® Person
 name Movie
 [Genre]
 title
 ACTED_IN DIRECTED roles:[“role1”,”role2”]
  • 7. Candidate Graph Model 4 GraphAware® Person
 name Movie
 title
 Genre
 name
 Role
 name
 HAS_GENRE PLAYED_ROLE ROLE ROLE_IN_MOVIE DIRECTED
  • 9. Don’t be afraid! GraphAware® ‣ Graph modelling is an extremely useful exercise ‣ Validate your understanding of the problem on a whiteboard ‣ The way you naturally represent your domain on the whiteboard is generally your graph model ‣ No normalisation rules required- all stakeholders can participate ‣ Expose gaps in thinking, missing data early ‣ This modelling is beneficial even if you’re not using a graph database ‣ But if you draw it as a graph, and think of it as a graph, you probably need a graph database
  • 11. Now what? GraphAware® ‣ Should role be ‣ a property on a relationship? ‣ a node?
  • 12. Now what? GraphAware® ‣ Should genre be ‣ a property on a node? ‣ a node? ‣ a label? ‣ both?
  • 15. What is the question? GraphAware® ‣ The use case or the question you’re asking of the graph will determine the most suitable graph model to ‣ Answer the question ‣ Perform efficient queries ‣ Keep things simple- model just enough, but no more
  • 16. ‣ As a movie fan, I want to find a movie, and see actors and their roles Use case #1 GraphAware®
  • 17. ‣ As a movie fan, I want to find a movie, and see actors and their roles Use case #1 GraphAware® Person
 name Movie
 title
 genre ACTED_IN DIRECTED roles:[“role1”,”role2”]
  • 18. ‣ As a movie fan, I want to find movies in genres similar to my favourites Use case #2 GraphAware®
  • 19. ‣ As a movie fan, I want to find movies in genres similar to my favourites Use case #2 GraphAware® Person
 name Movie
 title
 ACTED_IN DIRECTED roles:[“role1”,”role2”] Genre
 name
 HAS_GENRE Movie
 title
 Genre
 name
 ACTED_IN HAS_GENRE SIMILAR_TO
  • 20. ‣ As a movie fan, I want to find actors who played the role of Neo and the awards they won for this role Use case #3 GraphAware®
  • 21. ‣ As a movie fan, I want to find actors who played the role of Neo and the awards they won for this role Use case #3 GraphAware® Person
 name Movie
 title
 DIRECTED Genre
 name
 HAS_GENRE Movie
 title
 Genre
 name
 ACTED_IN HAS_GENRE SIMILAR_TO Role
 name
 <hyperedge> Award
 name
 PLAYED_ROLE AWARD_ROLE ROLE ROLE_IN_MOVIEYear
  • 22. Summary GraphAware® ‣ Know thy use case ‣ Keep it simple and intuitive ‣ Consider ‣ the shape and size of your data ‣ the density of relationships ‣ selectivity ‣ read vs write trade-offs ‣ Measure performance but… ‣ Do not prematurely optimise- graph model refactoring is easy!
  • 23. Hunger Games GraphAware® 1. Easy: To be able to model your graph well, you should know A. Your use case B. The weather C. A list of hair-metal bands 2. Medium: Should I model this fact as a property of a node, or a node? A. Property of a node B. A node C. It depends 3. Hard: Sometimes you need an edge that relates more than 2 nodes. What do you do? A. Use a relationship between two nodes, store the context as properties B. Use a hyper edge C. Model with multiple nodes but identify they belong together with a groupID 
 Answer at: r.neo4j.com/hunger-games