SlideShare a Scribd company logo
1 of 66
Download to read offline
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 …
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 Databases and Neo4j Explained

Choosing the right database
Choosing the right databaseChoosing the right database
Choosing the right databaseDavid Simons
 
Choosing the Right Database
Choosing the Right DatabaseChoosing the Right Database
Choosing the Right DatabaseDavid Simons
 
Data Modelling at Scale
Data Modelling at ScaleData Modelling at Scale
Data Modelling at ScaleDavid Simons
 
Serverless WordPress & next Interface of WordPress
Serverless WordPress & next Interface of WordPressServerless WordPress & next Interface of WordPress
Serverless WordPress & next Interface of WordPressHidetaka Okamoto
 
Neo4j a bit of math and magic
Neo4j a bit of math and magicNeo4j a bit of math and magic
Neo4j a bit of math and magicTetiana Chupryna
 
Bristol Uni - Use Cases of NoSQL
Bristol Uni - Use Cases of NoSQLBristol Uni - Use Cases of NoSQL
Bristol Uni - Use Cases of NoSQLDavid Simons
 
From Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsFrom Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsRonald Ashri
 
From Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsFrom Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsRonald Ashri
 
ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?
ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?
ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?Keita Bando
 
Canary Deployments on Amazon EKS with Istio - SRV305 - Chicago AWS Summit
Canary Deployments on Amazon EKS with Istio - SRV305 - Chicago AWS SummitCanary Deployments on Amazon EKS with Istio - SRV305 - Chicago AWS Summit
Canary Deployments on Amazon EKS with Istio - SRV305 - Chicago AWS SummitAmazon Web Services
 
Development and Deployment: The Human Factor
Development and Deployment: The Human FactorDevelopment and Deployment: The Human Factor
Development and Deployment: The Human FactorBoris Adryan
 
Mock proposal for digitisation project
Mock proposal for digitisation projectMock proposal for digitisation project
Mock proposal for digitisation projectGiada Gelli
 
Statistical Programming with JavaScript
Statistical Programming with JavaScriptStatistical Programming with JavaScript
Statistical Programming with JavaScriptDavid Simons
 
Revision 2021 Introduction to the Demoscene
Revision 2021 Introduction to the DemosceneRevision 2021 Introduction to the Demoscene
Revision 2021 Introduction to the DemosceneReza Esmaili
 
STC-PMC November 2016 Presentation - Mobile First Content
STC-PMC November 2016 Presentation - Mobile First ContentSTC-PMC November 2016 Presentation - Mobile First Content
STC-PMC November 2016 Presentation - Mobile First ContentSTC-Philadelphia Metro Chapter
 
Mining Events from Multimedia Streams (WAIS Research group seminar June 2014)
Mining Events from Multimedia Streams (WAIS Research group seminar June 2014)Mining Events from Multimedia Streams (WAIS Research group seminar June 2014)
Mining Events from Multimedia Streams (WAIS Research group seminar June 2014)Jonathon Hare
 
High quality Front-End
High quality Front-EndHigh quality Front-End
High quality Front-EndDavid Simons
 

Similar to Graph Databases and Neo4j Explained (20)

Choosing the right database
Choosing the right databaseChoosing the right database
Choosing the right database
 
Choosing the Right Database
Choosing the Right DatabaseChoosing the Right Database
Choosing the Right Database
 
Data Modelling at Scale
Data Modelling at ScaleData Modelling at Scale
Data Modelling at Scale
 
Serverless WordPress & next Interface of WordPress
Serverless WordPress & next Interface of WordPressServerless WordPress & next Interface of WordPress
Serverless WordPress & next Interface of WordPress
 
Neo4j a bit of math and magic
Neo4j a bit of math and magicNeo4j a bit of math and magic
Neo4j a bit of math and magic
 
Bristol Uni - Use Cases of NoSQL
Bristol Uni - Use Cases of NoSQLBristol Uni - Use Cases of NoSQL
Bristol Uni - Use Cases of NoSQL
 
From Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsFrom Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dots
 
From Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsFrom Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the Dots
 
ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?
ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?
ResearchGate - How do 'Social Networks for Scientists' Affect Libraries?
 
Canary Deployments on Amazon EKS with Istio - SRV305 - Chicago AWS Summit
Canary Deployments on Amazon EKS with Istio - SRV305 - Chicago AWS SummitCanary Deployments on Amazon EKS with Istio - SRV305 - Chicago AWS Summit
Canary Deployments on Amazon EKS with Istio - SRV305 - Chicago AWS Summit
 
Development and Deployment: The Human Factor
Development and Deployment: The Human FactorDevelopment and Deployment: The Human Factor
Development and Deployment: The Human Factor
 
Mock proposal for digitisation project
Mock proposal for digitisation projectMock proposal for digitisation project
Mock proposal for digitisation project
 
Statistical Programming with JavaScript
Statistical Programming with JavaScriptStatistical Programming with JavaScript
Statistical Programming with JavaScript
 
Revision 2021 Introduction to the Demoscene
Revision 2021 Introduction to the DemosceneRevision 2021 Introduction to the Demoscene
Revision 2021 Introduction to the Demoscene
 
STC-PMC November 2016 Presentation - Mobile First Content
STC-PMC November 2016 Presentation - Mobile First ContentSTC-PMC November 2016 Presentation - Mobile First Content
STC-PMC November 2016 Presentation - Mobile First Content
 
Agree to Disagree
Agree to DisagreeAgree to Disagree
Agree to Disagree
 
Mining Events from Multimedia Streams (WAIS Research group seminar June 2014)
Mining Events from Multimedia Streams (WAIS Research group seminar June 2014)Mining Events from Multimedia Streams (WAIS Research group seminar June 2014)
Mining Events from Multimedia Streams (WAIS Research group seminar June 2014)
 
The Swift Architect
The Swift ArchitectThe Swift Architect
The Swift Architect
 
High quality Front-End
High quality Front-EndHigh quality Front-End
High quality Front-End
 
Yes, you can git!
Yes, you can git!Yes, you can git!
Yes, you can git!
 

More from David Simons

Four Architectural Patterns
Four Architectural Patterns Four Architectural Patterns
Four Architectural Patterns David Simons
 
Decoupled APIs through Microservices
Decoupled APIs through MicroservicesDecoupled APIs through Microservices
Decoupled APIs through MicroservicesDavid Simons
 
Non-Functional Requirements
Non-Functional RequirementsNon-Functional Requirements
Non-Functional RequirementsDavid Simons
 
Build Tools & Maven
Build Tools & MavenBuild Tools & Maven
Build Tools & MavenDavid Simons
 
TDD: What is it good for?
TDD: What is it good for?TDD: What is it good for?
TDD: What is it good for?David Simons
 
Domain Driven Design: A Precis
Domain Driven Design: A PrecisDomain Driven Design: A Precis
Domain Driven Design: A PrecisDavid Simons
 
10 d bs in 30 minutes
10 d bs in 30 minutes10 d bs in 30 minutes
10 d bs in 30 minutesDavid Simons
 
Using Clojure to Marry Neo4j and Open Democracy
Using Clojure to Marry Neo4j and Open DemocracyUsing Clojure to Marry Neo4j and Open Democracy
Using Clojure to Marry Neo4j and Open DemocracyDavid Simons
 
Exploring Election Results with Neo4J
Exploring Election Results with Neo4JExploring Election Results with Neo4J
Exploring Election Results with Neo4JDavid Simons
 

More from David Simons (9)

Four Architectural Patterns
Four Architectural Patterns Four Architectural Patterns
Four Architectural Patterns
 
Decoupled APIs through Microservices
Decoupled APIs through MicroservicesDecoupled APIs through Microservices
Decoupled APIs through Microservices
 
Non-Functional Requirements
Non-Functional RequirementsNon-Functional Requirements
Non-Functional Requirements
 
Build Tools & Maven
Build Tools & MavenBuild Tools & Maven
Build Tools & Maven
 
TDD: What is it good for?
TDD: What is it good for?TDD: What is it good for?
TDD: What is it good for?
 
Domain Driven Design: A Precis
Domain Driven Design: A PrecisDomain Driven Design: A Precis
Domain Driven Design: A Precis
 
10 d bs in 30 minutes
10 d bs in 30 minutes10 d bs in 30 minutes
10 d bs in 30 minutes
 
Using Clojure to Marry Neo4j and Open Democracy
Using Clojure to Marry Neo4j and Open DemocracyUsing Clojure to Marry Neo4j and Open Democracy
Using Clojure to Marry Neo4j and Open Democracy
 
Exploring Election Results with Neo4J
Exploring Election Results with Neo4JExploring Election Results with Neo4J
Exploring Election Results with Neo4J
 

Recently uploaded

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

Graph Databases and Neo4j Explained

  • 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 …
  • 16.
  • 17.
  • 18.
  • 19.
  • 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