SlideShare a Scribd company logo
G R A P H DATA B A S ES
W H O A M I ?
• David Simons
• @SwamWithTurtles
• github.com/
SwamWithTurtles
• Technical Lead at Softwire
and part-time hacker
• Statistician in a past life
G ra p h i ca l M o d e l l i n g
N e o 4 J : T h e W h at A n d W h y ?
“ Cy p h e r ” Q u e ry La n g u a g e
Le t ’s S e e I t A ct i o n !
T h e G ra p h i n g Eco s y ste m
G ra p h i ca l M o d e l l i n g
N e o 4 J : T h e W h at A n d W h y ?
“ Cy p h e r ” Q u e ry La n g u a g e
Le t ’s S e e I t A ct i o n !
T h e G ra p h i n g Eco s y ste m
W H AT I S A G R A P H ?
Taken from Jim Webber’s Dr. Who Dataset
W H AT I S A G R A P H ?
{ (V, E) : V = [n], E ⊆ V(2) }
W H AT I S A G R A P H ?
{ (V, E) : V = [n], E ⊆ V(2) }
Made up of two parts,
“V” and “E”
W H AT I S A G R A P H ?
{ (V, E) : V = [n], E ⊆ V(2) }
V is a set of n items
W H AT I S A G R A P H ?
Vertex Set
W H AT I S A G R A P H ?
{ (V, E) : V = [n], E ⊆ V(2) }
E is made up of pairs
of elements of V
(Ordered and
not necessarily distinct)
W H AT I S A G R A P H ?
Edge Set
G I V I N G R E A L
W O R L D
M E A N I N G S T O V
A N D E
W H A T I S G R A P H I C A L
M O D E L L I N G ?
B R I D G E S AT K Ö N I G S B E R G
B R I D G E S AT K Ö N I G S B E R G
V =
bits of land
E =
bridges
K E V I N B A C O N
S I X D E G R E E S O F …
Graph Modelling
Graph Modelling
Graph Modelling
Graph Modelling
T H E R E I S N O O P E N
E L E C T I O N D ATA
T H E P R O B L E M
E L E C T I O N D ATA
E L E C T I O N D ATA
E L E C T I O N D ATA
E =
(e.g.) member of, held in,
stood in…
V =
elections, constituencies,
years, politicians and parties
G ra p h i ca l M o d e l l i n g
N e o 4 J : T h e W h at A n d W h y ?
“ Cy p h e r ” Q u e ry La n g u a g e
Le t ’s S e e I t A ct i o n !
T h e G ra p h i n g Eco s y ste m
W O R L D ’ S L E A D I N G G R A P H
D B :
W H E R E D I D I T
C O M E F R O M ?
• First version 2010, v2 came
out December 2013.
"embedded, disk-based, fully transactional Java
persistence engine that stores data structured in
graphs rather than in tables"
D ATA S T O R A G E
D ATA S T O R A G E
D ATA
S T O R A G E
• Nodes and edges are all:
• Stored as first-class
objects on the file
system
• “typed”
• Key-value stores
C O M M U N I T Y
E D I T I O N
• Free for hacking around in
E N T E R P R I S E
E D I T I O N
• Bespoke Prices, but
includes:
• Higher performance
for concurrent
querying
• Clustering
• Hot backups
• Advanced Monitoring
O T H E R G R A P H
D ATA B A S E S
• ArangoDB
• OrientDB
• New: Graph Engine
W H AT ’ S
W R O N G W I T H
S Q L ?
B U T…
N O T H I N G *
N O T H I N G *
*If you use it for
the right job
D ATA I N T H E
R E L AT I O N S
• “Joins” are first class
objects in the database
that can be queried at no
additional cost
• Certain queries become
trivial (e.g. Joins)
P R O T O T Y P I N G
• Easy to see and work with
data
• Schemaless
• Active community with a
lot of libraries
N E O 4 J U S E R S
C A S E S T U D I E S
Real-time Recommendations
C A S E S T U D I E S
Logistics & Delivery
Organisation
C A S E S T U D I E S
Online Dating
G ra p h i ca l M o d e l l i n g
N e o 4 J : T h e W h at A n d W h y ?
“ Cy p h e r ” Q u e ry La n g u a g e
Le t ’s S e e I t A ct i o n !
T h e G ra p h i n g Eco s y ste m
W H AT I S
C Y P H E R ?
• Neo4j’s own query
language
• Declarative
• Designed to be readable
and easy to learn
A S C I I A R T S Y N TA X : N O D E S
(n)
(n:Actor)
(n:Actor {name:”Kevin Bacon”})
A S C I I A R T S Y N TA X : E D G E S
-[r:starred_in]->
<-[r:starred_in]-
-[r:starred_in]-
A S C I I A R T S Y N TA X : E D G E S
(n:Actor)-[r:starred_in]->(m:Movie)
A S C I I A R T S Y N TA X : E D G E S
(n:Actor)-[r:starred_in]->(m:Movie)
<-[r:starred_in]-(a:Actor)
M AT C H & R E T U R N
MATCH {pattern} RETURN {variables}
M AT C H & R E T U R N
MATCH (n:Actor)-[r:starred_in]->(m:Movie)
RETURN n, r, m
M AT C H & R E T U R N
MATCH (n:Actor {name: ”Kevin Bacon”})
-[r:starred_in]->(m:Movie)
RETURN m
P E R S I S T E N C E
CREATE (n: Actor {name: “David”})
RETURN n
P E R S I S T E N C E
MATCH (m:Movie), (a:Actor {name =“David”})
CREATE (a)-[:starred_in]->(m)
RETURN a, m
A G G R E G AT I O N
MATCH (n:Actor)<-[:starred_in]-(m:Movie)
RETURN n, sum(m.revenue)
L O A D F R O M C S V
LOAD CSV FROM 'foo.csv' AS line
CREATE (:Actor { name: line[1]})
G ra p h i ca l M o d e l l i n g
N e o 4 J : T h e W h at A n d W h y ?
“ Cy p h e r ” Q u e ry La n g u a g e
Le t ’s S e e I t A ct i o n !
T h e G ra p h i n g Eco s y ste m
G ra p h i ca l M o d e l l i n g
N e o 4 J : T h e W h at A n d W h y ?
“ Cy p h e r ” Q u e ry La n g u a g e
Le t ’s S e e I t A ct i o n !
T h e G ra p h i n g Eco s y ste m
D I F F E R E N T
L A N G U A G E
S U P P O R T
• Java
• Spring Data for full
ORM
• Hibernate OGM
• Embedded Java API
• Kundera
D I F F E R E N T
L A N G U A G E
S U P P O R T
• .NET - Neo4jClient
• JavaScript - Seraph.js,
node-neo4j
• Clojure - Neocons
• Haskell, Go, PHP and
more…
G R A P H E N E D B
• Remote hosting of neo4j
on Heroku, AWS or Azure
• Monitoring, support, back-
ups, scalability
V I S U A L I S AT I O N
T O O L S
• Lots of tools out there to
take subgraphs and turn
them into pretty views.
V I S U A L I S AT I O N T O O L S : A L C H E M Y J S
V I S U A L I S AT I O N T O O L S : L I N K U R I O U S
G R A P H A WA R E
• Java libraries that make
developing with graphs
easier:
• “TimeTree”
• “GraphGen”
• “Reco”
I N
C O N C L U S I O N …
• Graphs more accurately
model a lot of domains
• Neo4j is a robust and
mature way of storing this
• It’s got a thriving
ecosystem and community
• Go forth and play!
A N Y Q U EST I O N S ?
@ Swa m Wi t h Tu rt l e s
s wa m w i t h t u rt l e s . co m

More Related Content

Similar to Graph Modelling (20)

PDF
Distributed graph processing
Bartosz Konieczny
 
PPTX
Graph Database Query Languages
Jay Coskey
 
PPTX
Graph Databases
thai
 
PPTX
Neo4j Training Introduction
Max De Marzi
 
ODP
Grails goes Graph
darthvader42
 
PPTX
Graph_Database_Prepared_by_Ali_Rajab.pptx
removed_d60a659b5ed8cd7a5e0931e92447dc14
 
PPTX
Graph_Databases__And_Its_Usage_Presentation.pptx
Ali Rajab
 
PDF
Intro to Graphs for Fedict
Rik Van Bruggen
 
PPTX
Calin Constantinov - Neo4j - Bucharest Big Data Week Meetup - Bucharest 2018
Calin Constantinov
 
PDF
Intro to Neo4j 2.0
Peter Neubauer
 
PPTX
Intro to Neo4j with Ruby
Max De Marzi
 
PDF
Graph Databases and Graph Data Science in Neo4j
ijtsrd
 
PPTX
Introduction to Graph Databases
Max De Marzi
 
ODP
Graph databases
Karol Grzegorczyk
 
PDF
Neo4j: Graph-like power
Roman Rodomansky
 
PPTX
Graph Databases in the Microsoft Ecosystem
Marco Parenzan
 
PPTX
GraphDatabase.pptx
JeyaVarthini1
 
PDF
Intro to Neo4j and Graph Databases
Neo4j
 
PPT
10. Graph Databases
Fabio Fumarola
 
PDF
Neo4j a bit of math and magic
Tetiana Chupryna
 
Distributed graph processing
Bartosz Konieczny
 
Graph Database Query Languages
Jay Coskey
 
Graph Databases
thai
 
Neo4j Training Introduction
Max De Marzi
 
Grails goes Graph
darthvader42
 
Graph_Database_Prepared_by_Ali_Rajab.pptx
removed_d60a659b5ed8cd7a5e0931e92447dc14
 
Graph_Databases__And_Its_Usage_Presentation.pptx
Ali Rajab
 
Intro to Graphs for Fedict
Rik Van Bruggen
 
Calin Constantinov - Neo4j - Bucharest Big Data Week Meetup - Bucharest 2018
Calin Constantinov
 
Intro to Neo4j 2.0
Peter Neubauer
 
Intro to Neo4j with Ruby
Max De Marzi
 
Graph Databases and Graph Data Science in Neo4j
ijtsrd
 
Introduction to Graph Databases
Max De Marzi
 
Graph databases
Karol Grzegorczyk
 
Neo4j: Graph-like power
Roman Rodomansky
 
Graph Databases in the Microsoft Ecosystem
Marco Parenzan
 
GraphDatabase.pptx
JeyaVarthini1
 
Intro to Neo4j and Graph Databases
Neo4j
 
10. Graph Databases
Fabio Fumarola
 
Neo4j a bit of math and magic
Tetiana Chupryna
 

More from David Simons (15)

PDF
Four Architectural Patterns
David Simons
 
PDF
Data Modelling at Scale
David Simons
 
PDF
Decoupled APIs through Microservices
David Simons
 
PDF
Statistical Programming with JavaScript
David Simons
 
PDF
Non-Functional Requirements
David Simons
 
PDF
High quality Front-End
David Simons
 
PDF
Bristol Uni - Use Cases of NoSQL
David Simons
 
PDF
Choosing the Right Database
David Simons
 
PPTX
Build Tools & Maven
David Simons
 
PDF
Choosing the right database
David Simons
 
PDF
TDD: What is it good for?
David Simons
 
PDF
Domain Driven Design: A Precis
David Simons
 
PDF
10 d bs in 30 minutes
David Simons
 
PPTX
Using Clojure to Marry Neo4j and Open Democracy
David Simons
 
PDF
Exploring Election Results with Neo4J
David Simons
 
Four Architectural Patterns
David Simons
 
Data Modelling at Scale
David Simons
 
Decoupled APIs through Microservices
David Simons
 
Statistical Programming with JavaScript
David Simons
 
Non-Functional Requirements
David Simons
 
High quality Front-End
David Simons
 
Bristol Uni - Use Cases of NoSQL
David Simons
 
Choosing the Right Database
David Simons
 
Build Tools & Maven
David Simons
 
Choosing the right database
David Simons
 
TDD: What is it good for?
David Simons
 
Domain Driven Design: A Precis
David Simons
 
10 d bs in 30 minutes
David Simons
 
Using Clojure to Marry Neo4j and Open Democracy
David Simons
 
Exploring Election Results with Neo4J
David Simons
 
Ad

Recently uploaded (20)

PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
July Patch Tuesday
Ivanti
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
July Patch Tuesday
Ivanti
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Ad

Graph Modelling

  • 1. G R A P H DATA B A S ES
  • 2. W H O A M I ? • David Simons • @SwamWithTurtles • github.com/ SwamWithTurtles • Technical Lead at Softwire and part-time hacker • Statistician in a past life
  • 3. G ra p h i ca l M o d e l l i n g N e o 4 J : T h e W h at A n d W h y ? “ Cy p h e r ” Q u e ry La n g u a g e Le t ’s S e e I t A ct i o n ! T h e G ra p h i n g Eco s y ste m
  • 4. G ra p h i ca l M o d e l l i n g N e o 4 J : T h e W h at A n d W h y ? “ Cy p h e r ” Q u e ry La n g u a g e Le t ’s S e e I t A ct i o n ! T h e G ra p h i n g Eco s y ste m
  • 5. W H AT I S A G R A P H ? Taken from Jim Webber’s Dr. Who Dataset
  • 6. W H AT I S A G R A P H ? { (V, E) : V = [n], E ⊆ V(2) }
  • 7. W H AT I S A G R A P H ? { (V, E) : V = [n], E ⊆ V(2) } Made up of two parts, “V” and “E”
  • 8. W H AT I S A G R A P H ? { (V, E) : V = [n], E ⊆ V(2) } V is a set of n items
  • 9. W H AT I S A G R A P H ? Vertex Set
  • 10. W H AT I S A G R A P H ? { (V, E) : V = [n], E ⊆ V(2) } E is made up of pairs of elements of V (Ordered and not necessarily distinct)
  • 11. W H AT I S A G R A P H ? Edge Set
  • 12. G I V I N G R E A L W O R L D M E A N I N G S T O V A N D E W H A T I S G R A P H I C A L M O D E L L I N G ?
  • 13. B R I D G E S AT K Ö N I G S B E R G
  • 14. B R I D G E S AT K Ö N I G S B E R G V = bits of land E = bridges
  • 15. K E V I N B A C O N S I X D E G R E E S O F …
  • 20. T H E R E I S N O O P E N E L E C T I O N D ATA T H E P R O B L E M
  • 21. E L E C T I O N D ATA
  • 22. E L E C T I O N D ATA
  • 23. E L E C T I O N D ATA E = (e.g.) member of, held in, stood in… V = elections, constituencies, years, politicians and parties
  • 24. G ra p h i ca l M o d e l l i n g N e o 4 J : T h e W h at A n d W h y ? “ Cy p h e r ” Q u e ry La n g u a g e Le t ’s S e e I t A ct i o n ! T h e G ra p h i n g Eco s y ste m
  • 25. W O R L D ’ S L E A D I N G G R A P H D B :
  • 26. W H E R E D I D I T C O M E F R O M ? • First version 2010, v2 came out December 2013.
  • 27. "embedded, disk-based, fully transactional Java persistence engine that stores data structured in graphs rather than in tables"
  • 28. D ATA S T O R A G E
  • 29. D ATA S T O R A G E
  • 30. D ATA S T O R A G E • Nodes and edges are all: • Stored as first-class objects on the file system • “typed” • Key-value stores
  • 31. C O M M U N I T Y E D I T I O N • Free for hacking around in
  • 32. E N T E R P R I S E E D I T I O N • Bespoke Prices, but includes: • Higher performance for concurrent querying • Clustering • Hot backups • Advanced Monitoring
  • 33. O T H E R G R A P H D ATA B A S E S • ArangoDB • OrientDB • New: Graph Engine
  • 34. W H AT ’ S W R O N G W I T H S Q L ? B U T…
  • 35. N O T H I N G *
  • 36. N O T H I N G * *If you use it for the right job
  • 37. D ATA I N T H E R E L AT I O N S • “Joins” are first class objects in the database that can be queried at no additional cost • Certain queries become trivial (e.g. Joins)
  • 38. P R O T O T Y P I N G • Easy to see and work with data • Schemaless • Active community with a lot of libraries
  • 39. N E O 4 J U S E R S
  • 40. C A S E S T U D I E S Real-time Recommendations
  • 41. C A S E S T U D I E S Logistics & Delivery Organisation
  • 42. C A S E S T U D I E S Online Dating
  • 43. G ra p h i ca l M o d e l l i n g N e o 4 J : T h e W h at A n d W h y ? “ Cy p h e r ” Q u e ry La n g u a g e Le t ’s S e e I t A ct i o n ! T h e G ra p h i n g Eco s y ste m
  • 44. W H AT I S C Y P H E R ? • Neo4j’s own query language • Declarative • Designed to be readable and easy to learn
  • 45. A S C I I A R T S Y N TA X : N O D E S (n) (n:Actor) (n:Actor {name:”Kevin Bacon”})
  • 46. A S C I I A R T S Y N TA X : E D G E S -[r:starred_in]-> <-[r:starred_in]- -[r:starred_in]-
  • 47. A S C I I A R T S Y N TA X : E D G E S (n:Actor)-[r:starred_in]->(m:Movie)
  • 48. A S C I I A R T S Y N TA X : E D G E S (n:Actor)-[r:starred_in]->(m:Movie) <-[r:starred_in]-(a:Actor)
  • 49. M AT C H & R E T U R N MATCH {pattern} RETURN {variables}
  • 50. M AT C H & R E T U R N MATCH (n:Actor)-[r:starred_in]->(m:Movie) RETURN n, r, m
  • 51. M AT C H & R E T U R N MATCH (n:Actor {name: ”Kevin Bacon”}) -[r:starred_in]->(m:Movie) RETURN m
  • 52. P E R S I S T E N C E CREATE (n: Actor {name: “David”}) RETURN n
  • 53. P E R S I S T E N C E MATCH (m:Movie), (a:Actor {name =“David”}) CREATE (a)-[:starred_in]->(m) RETURN a, m
  • 54. A G G R E G AT I O N MATCH (n:Actor)<-[:starred_in]-(m:Movie) RETURN n, sum(m.revenue)
  • 55. L O A D F R O M C S V LOAD CSV FROM 'foo.csv' AS line CREATE (:Actor { name: line[1]})
  • 56. G ra p h i ca l M o d e l l i n g N e o 4 J : T h e W h at A n d W h y ? “ Cy p h e r ” Q u e ry La n g u a g e Le t ’s S e e I t A ct i o n ! T h e G ra p h i n g Eco s y ste m
  • 57. G ra p h i ca l M o d e l l i n g N e o 4 J : T h e W h at A n d W h y ? “ Cy p h e r ” Q u e ry La n g u a g e Le t ’s S e e I t A ct i o n ! T h e G ra p h i n g Eco s y ste m
  • 58. D I F F E R E N T L A N G U A G E S U P P O R T • Java • Spring Data for full ORM • Hibernate OGM • Embedded Java API • Kundera
  • 59. D I F F E R E N T L A N G U A G E S U P P O R T • .NET - Neo4jClient • JavaScript - Seraph.js, node-neo4j • Clojure - Neocons • Haskell, Go, PHP and more…
  • 60. G R A P H E N E D B • Remote hosting of neo4j on Heroku, AWS or Azure • Monitoring, support, back- ups, scalability
  • 61. V I S U A L I S AT I O N T O O L S • Lots of tools out there to take subgraphs and turn them into pretty views.
  • 62. V I S U A L I S AT I O N T O O L S : A L C H E M Y J S
  • 63. V I S U A L I S AT I O N T O O L S : L I N K U R I O U S
  • 64. G R A P H A WA R E • Java libraries that make developing with graphs easier: • “TimeTree” • “GraphGen” • “Reco”
  • 65. I N C O N C L U S I O N … • Graphs more accurately model a lot of domains • Neo4j is a robust and mature way of storing this • It’s got a thriving ecosystem and community • Go forth and play!
  • 66. A N Y Q U EST I O N S ? @ Swa m Wi t h Tu rt l e s s wa m w i t h t u rt l e s . co m