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

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
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...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

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