Road to NODES 2023: Graphing Relational Databases

Neo4j
Neo4jOpen Source NOSQL Graph Database
© 2023 Neo4j, Inc. All rights reserved.
© 2023 Neo4j, Inc. All rights reserved.
1
Graphing Relational Databases
Ghlen Nagels (https://nagels.tech, @GhlenNagels)
Freelance Consultant @ Neo4j, aRes Travel Inc, NTC & more
© 2023 Neo4j, Inc. All rights reserved.
Plan
Introduction
When To Migrate
Example Project
In-Depth Cases
2
© 2023 Neo4j, Inc. All rights reserved.
3
Introduction
3
© 2023 Neo4j, Inc. All rights reserved.
Introduction: Experience
Telecommunications
Life sciences
- Provided Multiple Migration Services
- PHP Driver Author & Maintainer
- Authored much material on this
- Mapped ORM/Query Builder from
Relational to Graph
- Provided Multiple Tutorials / Workshops
4
© 2023 Neo4j, Inc. All rights reserved.
Introduction: Requirement Essentials
Telecommunications
Life sciences
- Understanding of basic SQL principles
- Understanding of basic Cypher/CQL query language
5
© 2023 Neo4j, Inc. All rights reserved.
Introduction: How to get the most out of this
Telecommunications
Life sciences
- Experience with migrating schemas, data and systems
- Have Docker installed
- Understand cursors and the impact on memory
- Have experience in PHP
6
© 2023 Neo4j, Inc. All rights reserved.
Introduction: Frustration
Telecommunications
Life sciences
7
© 2023 Neo4j, Inc. All rights reserved.
8
The promised Land
[LMW][AN]M[PJT]+ → [LMW][AN][MG][PJT]+
8
https://www.youtube.com/watch?v=dFgkXxoSwWo
© 2023 Neo4j, Inc. All rights reserved.
9
9
Ecosystem
© 2023 Neo4j, Inc. All rights reserved.
Path To The Promised Land: Option 1
Telecommunications
Life sciences
10
© 2023 Neo4j, Inc. All rights reserved.
Path To The Promised Land: Option 2
Telecommunications
Life sciences
11
© 2023 Neo4j, Inc. All rights reserved.
Path to the promised land:
Telecommunications
Life sciences
12
The ecosystem does not necessarily
help you get there
Proper planning and understanding
your data model does
© 2023 Neo4j, Inc. All rights reserved.
Introduction: Mindset
Telecommunications
Life sciences
13
- Confidence:
Relational Database Models can be Directly translated to Graphs
- Understanding:
The real challenge is understanding you own Data Model
- Patterns:
Every DB pattern has a solution on how to translate it to Graphs
(we’ll see 4 patterns today)
© 2023 Neo4j, Inc. All rights reserved.
14
When to Migrate
14
© 2023 Neo4j, Inc. All rights reserved.
When to Migrate
Telecommunications
Life sciences
15
- Holistic Problem
- Always complicated
- Risk versus Reward
A collection of indicators help decide
© 2023 Neo4j, Inc. All rights reserved.
Migration Indicator: Slow join operations
Telecommunications
Life sciences
16
- Relationships are not a first class-citizen
in Relational Databases
- Recursive joins and big datasets put a chokehold
on Your Applications
- Almost all other Indicators are actually
Sub-optimal solutions to this
© 2023 Neo4j, Inc. All rights reserved.
Migration Indicator: Caches for everything
Telecommunications
Life sciences
17
- A cache is a great tool to optimise performance
- Premature optimisation is the root of all evil
- Caching introduces data duplication
- Cache flushing is a horrible problem to have
especially in complex server topologies
© 2023 Neo4j, Inc. All rights reserved.
Migration Indicator: Esoteric Solutions (for simple problems)
Telecommunications
Life sciences
18
- Ever come up with your own indexing system?
- Polymorphism (see later)
- Materialised views
- Database triggers
- Dynamic queries without parameters
- Verrrryyy lazy loading
- …
© 2023 Neo4j, Inc. All rights reserved.
Migration Indicator: Non Normalised Tables
Telecommunications
Life sciences
19
- They actually taught me this in college
- Willfully introduces data duplicity to improve performance
© 2023 Neo4j, Inc. All rights reserved.
Migration Indicator: Lots of DB Migrations
Telecommunications
Life sciences
20
- Constantly changing data models
- Are being hampered by a system with forced schemas
- Changing, moving and splitting tables are expensive
- Complicates CI
© 2023 Neo4j, Inc. All rights reserved.
Migration Indicator: Painful Data Science Stack
Telecommunications
Life sciences
21
© 2023 Neo4j, Inc. All rights reserved.
22
Example Project
22
© 2023 Neo4j, Inc. All rights reserved.
Example Project: The Schema
Telecommunications
Life sciences
23
© 2023 Neo4j, Inc. All rights reserved.
Example Project: Key Takeaways
Telecommunications
Life sciences
24
- Simple Join: Comments have one user
- Self Join: Articles and Comments are hierarchical
- Pivot Table: An Article may contain multiple Tags
A Tag can tag multiple Articles
- Polymorphism: Categories are all-encompassing
© 2023 Neo4j, Inc. All rights reserved.
Example Project: Goals
Telecommunications
Life sciences
25
- Query Simplications
- Speed upgrades
- Easy Migration
© 2023 Neo4j, Inc. All rights reserved.
Neo4j Workshop
⚡ Let’s get down to business 💻
26
https://github.com/transistive/book-example
© 2023 Neo4j, Inc. All rights reserved.
Query Simplifications: Simple Join
Telecommunications
Life sciences
27
© 2023 Neo4j, Inc. All rights reserved.
Query Simplifications: Self Join
Telecommunications
Life sciences
28
© 2023 Neo4j, Inc. All rights reserved.
Query Simplifications: Pivot Table
Telecommunications
Life sciences
29
© 2023 Neo4j, Inc. All rights reserved.
Query Simplifications: Polymorphism
Telecommunications
Life sciences
30
© 2023 Neo4j, Inc. All rights reserved.
Query Simplifications: Polymorphism
Telecommunications
Life sciences
31
© 2023 Neo4j, Inc. All rights reserved.
Query Simplifications: Key Insight
32
All four cases map to the same data solution
© 2023 Neo4j, Inc. All rights reserved.
Query Simplifications: Another Unfair Example
Telecommunications
Life sciences
33
How to query the hierarchical structure of articles?
© 2023 Neo4j, Inc. All rights reserved.
Query Simplifications: Another Unfair Example
Telecommunications
Life sciences
34
© 2023 Neo4j, Inc. All rights reserved.
Query Simplifications: Another Unfair Example
Telecommunications
Life sciences
35
© 2023 Neo4j, Inc. All rights reserved.
36
In-Depth Cases
36
© 2023 Neo4j, Inc. All rights reserved.
Overall Strategy
Telecommunications
Life sciences
37
- Identify what is a Node and a Relationship
- Insert the Nodes with the original identification
in the origin database
- Connect the Relationships using the original identification in
the original database. AKA the FINAL JOIN
- Optional: Wipe original database identification
© 2023 Neo4j, Inc. All rights reserved.
In-Depth Cases: Nodes
Telecommunications
Life sciences
38
© 2023 Neo4j, Inc. All rights reserved.
In-Depth Cases: Simple joins & self joins
Telecommunications
Life sciences
39
- The connection information is in both pair of nodes
- MERGE is your friend
- Introduce a cartesian product with a where
expression limiting the matches
- Potentially optimise performance with Indexes
(Congratulations, you just reinvented foreign keys in a graph database)
- Use Limit + Result Summary to chunk the query if required
© 2023 Neo4j, Inc. All rights reserved.
In-Depth Cases: Relationships
Telecommunications
Life sciences
40
© 2023 Neo4j, Inc. All rights reserved.
In-Depth Cases: Pivot tables
Telecommunications
Life sciences
41
- The pivot table is the relationship
- Use the identifying information to match a cartesian product,
limited through a Where Expression
- All other rules apply
- Remove the Pivot Table Nodes
© 2023 Neo4j, Inc. All rights reserved.
In-Depth Cases: Polymorphism
Telecommunications
Life sciences
42
- Treat the polymorphic table as a pivot table
- Use application level logic to translate the table names to
node labels
© 2023 Neo4j, Inc. All rights reserved.
Neo4j Workshop
⚡ Let’s get down to business 💻
43
back to the same code
© 2023 Neo4j, Inc. All rights reserved.
Let’s stay connected
with the community
dev.neo4j.com/chat
© 2023 Neo4j, Inc. All rights reserved.
Let’s stay connected
ghlen@nagels.tech
Whatsapp
+32 485 49 64 90
© 2023 Neo4j, Inc. All rights reserved.
© 2023 Neo4j, Inc. All rights reserved.
Thank You!
Special thanks to: Martin O’Hanlon and
Jennifer Reif
Questions?
1 of 46

Recommended

Knowledge Graphs for Network Digital Twins by
Knowledge Graphs for Network Digital TwinsKnowledge Graphs for Network Digital Twins
Knowledge Graphs for Network Digital TwinsNeo4j
143 views20 slides
Telecoms Service Assurance & Service Fulfillment with Neo4j Graph Database by
Telecoms Service Assurance & Service Fulfillment with Neo4j Graph DatabaseTelecoms Service Assurance & Service Fulfillment with Neo4j Graph Database
Telecoms Service Assurance & Service Fulfillment with Neo4j Graph DatabaseNeo4j
118 views21 slides
Spark and Deep Learning Frameworks at Scale 7.19.18 by
Spark and Deep Learning Frameworks at Scale 7.19.18Spark and Deep Learning Frameworks at Scale 7.19.18
Spark and Deep Learning Frameworks at Scale 7.19.18Cloudera, Inc.
820 views51 slides
Transforming BT’s Infrastructure Management with Graph Technology by
Transforming BT’s Infrastructure Management with Graph TechnologyTransforming BT’s Infrastructure Management with Graph Technology
Transforming BT’s Infrastructure Management with Graph TechnologyNeo4j
323 views23 slides
Neo4j: The path to success with Graph Database and Graph Data Science by
Neo4j: The path to success with Graph Database and Graph Data ScienceNeo4j: The path to success with Graph Database and Graph Data Science
Neo4j: The path to success with Graph Database and Graph Data ScienceNeo4j
83 views44 slides
Optimizing Your Supply Chain with Neo4j by
Optimizing Your Supply Chain with Neo4jOptimizing Your Supply Chain with Neo4j
Optimizing Your Supply Chain with Neo4jNeo4j
30 views39 slides

More Related Content

Similar to Road to NODES 2023: Graphing Relational Databases

El camino hacia el éxito con las bases de datos de grafos, la ciencia de dato... by
El camino hacia el éxito con las bases de datos de grafos, la ciencia de dato...El camino hacia el éxito con las bases de datos de grafos, la ciencia de dato...
El camino hacia el éxito con las bases de datos de grafos, la ciencia de dato...Neo4j
61 views49 slides
Mass Scale Networking by
Mass Scale NetworkingMass Scale Networking
Mass Scale NetworkingSteve Iatrou
11 views37 slides
The art of the possible with graph technology_Neo4j GraphSummit Dublin 2023.pptx by
The art of the possible with graph technology_Neo4j GraphSummit Dublin 2023.pptxThe art of the possible with graph technology_Neo4j GraphSummit Dublin 2023.pptx
The art of the possible with graph technology_Neo4j GraphSummit Dublin 2023.pptxNeo4j
188 views29 slides
The Neo4j Data Platform for Today & Tomorrow.pdf by
The Neo4j Data Platform for Today & Tomorrow.pdfThe Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdfNeo4j
157 views53 slides
Data Lineage, Property Based Testing & Neo4j by
Data Lineage, Property Based Testing & Neo4j Data Lineage, Property Based Testing & Neo4j
Data Lineage, Property Based Testing & Neo4j Neo4j
84 views13 slides
Workshop - Build a Graph Solution by
Workshop - Build a Graph SolutionWorkshop - Build a Graph Solution
Workshop - Build a Graph SolutionNeo4j
94 views61 slides

Similar to Road to NODES 2023: Graphing Relational Databases(20)

El camino hacia el éxito con las bases de datos de grafos, la ciencia de dato... by Neo4j
El camino hacia el éxito con las bases de datos de grafos, la ciencia de dato...El camino hacia el éxito con las bases de datos de grafos, la ciencia de dato...
El camino hacia el éxito con las bases de datos de grafos, la ciencia de dato...
Neo4j61 views
The art of the possible with graph technology_Neo4j GraphSummit Dublin 2023.pptx by Neo4j
The art of the possible with graph technology_Neo4j GraphSummit Dublin 2023.pptxThe art of the possible with graph technology_Neo4j GraphSummit Dublin 2023.pptx
The art of the possible with graph technology_Neo4j GraphSummit Dublin 2023.pptx
Neo4j188 views
The Neo4j Data Platform for Today & Tomorrow.pdf by Neo4j
The Neo4j Data Platform for Today & Tomorrow.pdfThe Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdf
Neo4j157 views
Data Lineage, Property Based Testing & Neo4j by Neo4j
Data Lineage, Property Based Testing & Neo4j Data Lineage, Property Based Testing & Neo4j
Data Lineage, Property Based Testing & Neo4j
Neo4j84 views
Workshop - Build a Graph Solution by Neo4j
Workshop - Build a Graph SolutionWorkshop - Build a Graph Solution
Workshop - Build a Graph Solution
Neo4j94 views
IRJET- Top-K Query Processing using Top Order Preserving Encryption (TOPE) by IRJET Journal
IRJET- Top-K Query Processing using Top Order Preserving Encryption (TOPE)IRJET- Top-K Query Processing using Top Order Preserving Encryption (TOPE)
IRJET- Top-K Query Processing using Top Order Preserving Encryption (TOPE)
IRJET Journal19 views
Dagster - DataOps and MLOps for Machine Learning Engineers.pdf by Hong Ong
Dagster - DataOps and MLOps for Machine Learning Engineers.pdfDagster - DataOps and MLOps for Machine Learning Engineers.pdf
Dagster - DataOps and MLOps for Machine Learning Engineers.pdf
Hong Ong86 views
The path to success with graph database and graph data science_ Neo4j GraphSu... by Neo4j
The path to success with graph database and graph data science_ Neo4j GraphSu...The path to success with graph database and graph data science_ Neo4j GraphSu...
The path to success with graph database and graph data science_ Neo4j GraphSu...
Neo4j91 views
Neo4j GraphSummit London March 2023 Emil Eifrem Keynote.pptx by Neo4j
Neo4j GraphSummit London March 2023 Emil Eifrem Keynote.pptxNeo4j GraphSummit London March 2023 Emil Eifrem Keynote.pptx
Neo4j GraphSummit London March 2023 Emil Eifrem Keynote.pptx
Neo4j127 views
PyMADlib - A Python wrapper for MADlib : in-database, parallel, machine learn... by Srivatsan Ramanujam
PyMADlib - A Python wrapper for MADlib : in-database, parallel, machine learn...PyMADlib - A Python wrapper for MADlib : in-database, parallel, machine learn...
PyMADlib - A Python wrapper for MADlib : in-database, parallel, machine learn...
Srivatsan Ramanujam2.9K views
IRJET- Efficient Geometric Range Search on RTREE Occupying Encrypted Spatial ... by IRJET Journal
IRJET- Efficient Geometric Range Search on RTREE Occupying Encrypted Spatial ...IRJET- Efficient Geometric Range Search on RTREE Occupying Encrypted Spatial ...
IRJET- Efficient Geometric Range Search on RTREE Occupying Encrypted Spatial ...
IRJET Journal15 views
Neo4j : la voie du succès avec les bases de données de graphes et la Graph Da... by Neo4j
Neo4j : la voie du succès avec les bases de données de graphes et la Graph Da...Neo4j : la voie du succès avec les bases de données de graphes et la Graph Da...
Neo4j : la voie du succès avec les bases de données de graphes et la Graph Da...
Neo4j39 views
Show and Tell - Data and Digitalisation, Digital Twins.pdf by SIFOfgem
Show and Tell - Data and Digitalisation, Digital Twins.pdfShow and Tell - Data and Digitalisation, Digital Twins.pdf
Show and Tell - Data and Digitalisation, Digital Twins.pdf
SIFOfgem204 views
The Art of the Possible with Graph Technology by Neo4j
The Art of the Possible with Graph TechnologyThe Art of the Possible with Graph Technology
The Art of the Possible with Graph Technology
Neo4j15 views
Capella Days 2021 | An example of model-centric engineering environment with ... by Obeo
Capella Days 2021 | An example of model-centric engineering environment with ...Capella Days 2021 | An example of model-centric engineering environment with ...
Capella Days 2021 | An example of model-centric engineering environment with ...
Obeo251 views
CV of Minfeng Hu by Minfeng Hu
CV of Minfeng HuCV of Minfeng Hu
CV of Minfeng Hu
Minfeng Hu146 views

More from Neo4j

FIMA 2023 Neo4j & FS - Entity Resolution.pptx by
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptxNeo4j
8 views26 slides
Operations & Data Graph by
Operations & Data GraphOperations & Data Graph
Operations & Data GraphNeo4j
42 views25 slides
TAGTTOO: La nova xarxa social by
TAGTTOO: La nova xarxa socialTAGTTOO: La nova xarxa social
TAGTTOO: La nova xarxa socialNeo4j
26 views19 slides
El Arte de lo Possible by
El Arte de lo PossibleEl Arte de lo Possible
El Arte de lo PossibleNeo4j
48 views35 slides
Neo4j y GenAI by
Neo4j y GenAI Neo4j y GenAI
Neo4j y GenAI Neo4j
54 views41 slides
Roadmap y Novedades de producto by
Roadmap y Novedades de productoRoadmap y Novedades de producto
Roadmap y Novedades de productoNeo4j
56 views33 slides

More from Neo4j(20)

FIMA 2023 Neo4j & FS - Entity Resolution.pptx by Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j8 views
Operations & Data Graph by Neo4j
Operations & Data GraphOperations & Data Graph
Operations & Data Graph
Neo4j42 views
TAGTTOO: La nova xarxa social by Neo4j
TAGTTOO: La nova xarxa socialTAGTTOO: La nova xarxa social
TAGTTOO: La nova xarxa social
Neo4j26 views
El Arte de lo Possible by Neo4j
El Arte de lo PossibleEl Arte de lo Possible
El Arte de lo Possible
Neo4j48 views
Neo4j y GenAI by Neo4j
Neo4j y GenAI Neo4j y GenAI
Neo4j y GenAI
Neo4j54 views
Roadmap y Novedades de producto by Neo4j
Roadmap y Novedades de productoRoadmap y Novedades de producto
Roadmap y Novedades de producto
Neo4j56 views
Neo4j : Graphes de Connaissance, IA et LLMs by Neo4j
Neo4j : Graphes de Connaissance, IA et LLMsNeo4j : Graphes de Connaissance, IA et LLMs
Neo4j : Graphes de Connaissance, IA et LLMs
Neo4j53 views
Les nouveautés produit Neo4j by Neo4j
 Les nouveautés produit Neo4j Les nouveautés produit Neo4j
Les nouveautés produit Neo4j
Neo4j31 views
Sopra Steria : Analyse intelligente des réseaux dans le domaine des télécommu... by Neo4j
Sopra Steria : Analyse intelligente des réseaux dans le domaine des télécommu...Sopra Steria : Analyse intelligente des réseaux dans le domaine des télécommu...
Sopra Steria : Analyse intelligente des réseaux dans le domaine des télécommu...
Neo4j27 views
Generali : SPIDER, notre produit au cœur des enjeux Generali en termes de Com... by Neo4j
Generali : SPIDER, notre produit au cœur des enjeux Generali en termes de Com...Generali : SPIDER, notre produit au cœur des enjeux Generali en termes de Com...
Generali : SPIDER, notre produit au cœur des enjeux Generali en termes de Com...
Neo4j54 views
Neo4j Generative AI workshop at GraphSummit London 14 Nov 2023.pdf by Neo4j
Neo4j Generative AI workshop at GraphSummit London 14 Nov 2023.pdfNeo4j Generative AI workshop at GraphSummit London 14 Nov 2023.pdf
Neo4j Generative AI workshop at GraphSummit London 14 Nov 2023.pdf
Neo4j58 views
Neo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptx by Neo4j
Neo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptxNeo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptx
Neo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptx
Neo4j55 views
Neo4j workshop at GraphSummit London 14 Nov 2023.pdf by Neo4j
Neo4j workshop at GraphSummit London 14 Nov 2023.pdfNeo4j workshop at GraphSummit London 14 Nov 2023.pdf
Neo4j workshop at GraphSummit London 14 Nov 2023.pdf
Neo4j53 views
Neo4j Product Updates & Knowledge Graphs at GraphSummit London 14 Nov 2023.pptx by Neo4j
Neo4j Product Updates & Knowledge Graphs at GraphSummit London 14 Nov 2023.pptxNeo4j Product Updates & Knowledge Graphs at GraphSummit London 14 Nov 2023.pptx
Neo4j Product Updates & Knowledge Graphs at GraphSummit London 14 Nov 2023.pptx
Neo4j66 views
AstraZeneca at Neo4j GraphSummit London 14Nov23.pptx by Neo4j
AstraZeneca at Neo4j GraphSummit London 14Nov23.pptxAstraZeneca at Neo4j GraphSummit London 14Nov23.pptx
AstraZeneca at Neo4j GraphSummit London 14Nov23.pptx
Neo4j45 views
Google Cloud at GraphSummit London 14 Nov 2023.pptx by Neo4j
Google Cloud at GraphSummit London 14 Nov 2023.pptxGoogle Cloud at GraphSummit London 14 Nov 2023.pptx
Google Cloud at GraphSummit London 14 Nov 2023.pptx
Neo4j27 views
The Art of the Possible with Graph - Sudhir Hasbe - GraphSummit London 14 Nov... by Neo4j
The Art of the Possible with Graph - Sudhir Hasbe - GraphSummit London 14 Nov...The Art of the Possible with Graph - Sudhir Hasbe - GraphSummit London 14 Nov...
The Art of the Possible with Graph - Sudhir Hasbe - GraphSummit London 14 Nov...
Neo4j77 views
Northern Gas Networks and CKDelta at Neo4j GraphSummit London 14Nov23.pptx by Neo4j
Northern Gas Networks and CKDelta at Neo4j GraphSummit London 14Nov23.pptxNorthern Gas Networks and CKDelta at Neo4j GraphSummit London 14Nov23.pptx
Northern Gas Networks and CKDelta at Neo4j GraphSummit London 14Nov23.pptx
Neo4j46 views
Peek into Neo4j Product Strategy and Roadmap by Neo4j
Peek into Neo4j Product Strategy and RoadmapPeek into Neo4j Product Strategy and Roadmap
Peek into Neo4j Product Strategy and Roadmap
Neo4j87 views
Transforming Intelligence Analysis with Knowledge Graphs by Neo4j
Transforming Intelligence Analysis with Knowledge GraphsTransforming Intelligence Analysis with Knowledge Graphs
Transforming Intelligence Analysis with Knowledge Graphs
Neo4j61 views

Recently uploaded

.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... by
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...Marc Müller
40 views62 slides
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft... by
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...Deltares
7 views18 slides
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... by
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Marc Müller
41 views83 slides
FOSSLight Community Day 2023-11-30 by
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30Shane Coughlan
5 views18 slides
EV Charging App Case by
EV Charging App Case EV Charging App Case
EV Charging App Case iCoderz Solutions
5 views1 slide
Quality Engineer: A Day in the Life by
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the LifeJohn Valentino
6 views18 slides

Recently uploaded(20)

.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... by Marc Müller
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
Marc Müller40 views
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft... by Deltares
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
Deltares7 views
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... by Marc Müller
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Marc Müller41 views
FOSSLight Community Day 2023-11-30 by Shane Coughlan
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30
Shane Coughlan5 views
Quality Engineer: A Day in the Life by John Valentino
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the Life
John Valentino6 views
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action by Márton Kodok
Gen Apps on Google Cloud PaLM2 and Codey APIs in ActionGen Apps on Google Cloud PaLM2 and Codey APIs in Action
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action
Márton Kodok6 views
Ports-and-Adapters Architecture for Embedded HMI by Burkhard Stubert
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMI
Burkhard Stubert21 views
Headless JS UG Presentation.pptx by Jack Spektor
Headless JS UG Presentation.pptxHeadless JS UG Presentation.pptx
Headless JS UG Presentation.pptx
Jack Spektor8 views
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with... by sparkfabrik
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
20231129 - Platform @ localhost 2023 - Application-driven infrastructure with...
sparkfabrik7 views
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx by animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm15 views
Myths and Facts About Hospice Care: Busting Common Misconceptions by Care Coordinations
Myths and Facts About Hospice Care: Busting Common MisconceptionsMyths and Facts About Hospice Care: Busting Common Misconceptions
Myths and Facts About Hospice Care: Busting Common Misconceptions
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko... by Deltares
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
Deltares14 views
tecnologia18.docx by nosi6702
tecnologia18.docxtecnologia18.docx
tecnologia18.docx
nosi67025 views
AI and Ml presentation .pptx by FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8712 views
Sprint 226 by ManageIQ
Sprint 226Sprint 226
Sprint 226
ManageIQ5 views

Road to NODES 2023: Graphing Relational Databases

  • 1. © 2023 Neo4j, Inc. All rights reserved. © 2023 Neo4j, Inc. All rights reserved. 1 Graphing Relational Databases Ghlen Nagels (https://nagels.tech, @GhlenNagels) Freelance Consultant @ Neo4j, aRes Travel Inc, NTC & more
  • 2. © 2023 Neo4j, Inc. All rights reserved. Plan Introduction When To Migrate Example Project In-Depth Cases 2
  • 3. © 2023 Neo4j, Inc. All rights reserved. 3 Introduction 3
  • 4. © 2023 Neo4j, Inc. All rights reserved. Introduction: Experience Telecommunications Life sciences - Provided Multiple Migration Services - PHP Driver Author & Maintainer - Authored much material on this - Mapped ORM/Query Builder from Relational to Graph - Provided Multiple Tutorials / Workshops 4
  • 5. © 2023 Neo4j, Inc. All rights reserved. Introduction: Requirement Essentials Telecommunications Life sciences - Understanding of basic SQL principles - Understanding of basic Cypher/CQL query language 5
  • 6. © 2023 Neo4j, Inc. All rights reserved. Introduction: How to get the most out of this Telecommunications Life sciences - Experience with migrating schemas, data and systems - Have Docker installed - Understand cursors and the impact on memory - Have experience in PHP 6
  • 7. © 2023 Neo4j, Inc. All rights reserved. Introduction: Frustration Telecommunications Life sciences 7
  • 8. © 2023 Neo4j, Inc. All rights reserved. 8 The promised Land [LMW][AN]M[PJT]+ → [LMW][AN][MG][PJT]+ 8 https://www.youtube.com/watch?v=dFgkXxoSwWo
  • 9. © 2023 Neo4j, Inc. All rights reserved. 9 9 Ecosystem
  • 10. © 2023 Neo4j, Inc. All rights reserved. Path To The Promised Land: Option 1 Telecommunications Life sciences 10
  • 11. © 2023 Neo4j, Inc. All rights reserved. Path To The Promised Land: Option 2 Telecommunications Life sciences 11
  • 12. © 2023 Neo4j, Inc. All rights reserved. Path to the promised land: Telecommunications Life sciences 12 The ecosystem does not necessarily help you get there Proper planning and understanding your data model does
  • 13. © 2023 Neo4j, Inc. All rights reserved. Introduction: Mindset Telecommunications Life sciences 13 - Confidence: Relational Database Models can be Directly translated to Graphs - Understanding: The real challenge is understanding you own Data Model - Patterns: Every DB pattern has a solution on how to translate it to Graphs (we’ll see 4 patterns today)
  • 14. © 2023 Neo4j, Inc. All rights reserved. 14 When to Migrate 14
  • 15. © 2023 Neo4j, Inc. All rights reserved. When to Migrate Telecommunications Life sciences 15 - Holistic Problem - Always complicated - Risk versus Reward A collection of indicators help decide
  • 16. © 2023 Neo4j, Inc. All rights reserved. Migration Indicator: Slow join operations Telecommunications Life sciences 16 - Relationships are not a first class-citizen in Relational Databases - Recursive joins and big datasets put a chokehold on Your Applications - Almost all other Indicators are actually Sub-optimal solutions to this
  • 17. © 2023 Neo4j, Inc. All rights reserved. Migration Indicator: Caches for everything Telecommunications Life sciences 17 - A cache is a great tool to optimise performance - Premature optimisation is the root of all evil - Caching introduces data duplication - Cache flushing is a horrible problem to have especially in complex server topologies
  • 18. © 2023 Neo4j, Inc. All rights reserved. Migration Indicator: Esoteric Solutions (for simple problems) Telecommunications Life sciences 18 - Ever come up with your own indexing system? - Polymorphism (see later) - Materialised views - Database triggers - Dynamic queries without parameters - Verrrryyy lazy loading - …
  • 19. © 2023 Neo4j, Inc. All rights reserved. Migration Indicator: Non Normalised Tables Telecommunications Life sciences 19 - They actually taught me this in college - Willfully introduces data duplicity to improve performance
  • 20. © 2023 Neo4j, Inc. All rights reserved. Migration Indicator: Lots of DB Migrations Telecommunications Life sciences 20 - Constantly changing data models - Are being hampered by a system with forced schemas - Changing, moving and splitting tables are expensive - Complicates CI
  • 21. © 2023 Neo4j, Inc. All rights reserved. Migration Indicator: Painful Data Science Stack Telecommunications Life sciences 21
  • 22. © 2023 Neo4j, Inc. All rights reserved. 22 Example Project 22
  • 23. © 2023 Neo4j, Inc. All rights reserved. Example Project: The Schema Telecommunications Life sciences 23
  • 24. © 2023 Neo4j, Inc. All rights reserved. Example Project: Key Takeaways Telecommunications Life sciences 24 - Simple Join: Comments have one user - Self Join: Articles and Comments are hierarchical - Pivot Table: An Article may contain multiple Tags A Tag can tag multiple Articles - Polymorphism: Categories are all-encompassing
  • 25. © 2023 Neo4j, Inc. All rights reserved. Example Project: Goals Telecommunications Life sciences 25 - Query Simplications - Speed upgrades - Easy Migration
  • 26. © 2023 Neo4j, Inc. All rights reserved. Neo4j Workshop ⚡ Let’s get down to business 💻 26 https://github.com/transistive/book-example
  • 27. © 2023 Neo4j, Inc. All rights reserved. Query Simplifications: Simple Join Telecommunications Life sciences 27
  • 28. © 2023 Neo4j, Inc. All rights reserved. Query Simplifications: Self Join Telecommunications Life sciences 28
  • 29. © 2023 Neo4j, Inc. All rights reserved. Query Simplifications: Pivot Table Telecommunications Life sciences 29
  • 30. © 2023 Neo4j, Inc. All rights reserved. Query Simplifications: Polymorphism Telecommunications Life sciences 30
  • 31. © 2023 Neo4j, Inc. All rights reserved. Query Simplifications: Polymorphism Telecommunications Life sciences 31
  • 32. © 2023 Neo4j, Inc. All rights reserved. Query Simplifications: Key Insight 32 All four cases map to the same data solution
  • 33. © 2023 Neo4j, Inc. All rights reserved. Query Simplifications: Another Unfair Example Telecommunications Life sciences 33 How to query the hierarchical structure of articles?
  • 34. © 2023 Neo4j, Inc. All rights reserved. Query Simplifications: Another Unfair Example Telecommunications Life sciences 34
  • 35. © 2023 Neo4j, Inc. All rights reserved. Query Simplifications: Another Unfair Example Telecommunications Life sciences 35
  • 36. © 2023 Neo4j, Inc. All rights reserved. 36 In-Depth Cases 36
  • 37. © 2023 Neo4j, Inc. All rights reserved. Overall Strategy Telecommunications Life sciences 37 - Identify what is a Node and a Relationship - Insert the Nodes with the original identification in the origin database - Connect the Relationships using the original identification in the original database. AKA the FINAL JOIN - Optional: Wipe original database identification
  • 38. © 2023 Neo4j, Inc. All rights reserved. In-Depth Cases: Nodes Telecommunications Life sciences 38
  • 39. © 2023 Neo4j, Inc. All rights reserved. In-Depth Cases: Simple joins & self joins Telecommunications Life sciences 39 - The connection information is in both pair of nodes - MERGE is your friend - Introduce a cartesian product with a where expression limiting the matches - Potentially optimise performance with Indexes (Congratulations, you just reinvented foreign keys in a graph database) - Use Limit + Result Summary to chunk the query if required
  • 40. © 2023 Neo4j, Inc. All rights reserved. In-Depth Cases: Relationships Telecommunications Life sciences 40
  • 41. © 2023 Neo4j, Inc. All rights reserved. In-Depth Cases: Pivot tables Telecommunications Life sciences 41 - The pivot table is the relationship - Use the identifying information to match a cartesian product, limited through a Where Expression - All other rules apply - Remove the Pivot Table Nodes
  • 42. © 2023 Neo4j, Inc. All rights reserved. In-Depth Cases: Polymorphism Telecommunications Life sciences 42 - Treat the polymorphic table as a pivot table - Use application level logic to translate the table names to node labels
  • 43. © 2023 Neo4j, Inc. All rights reserved. Neo4j Workshop ⚡ Let’s get down to business 💻 43 back to the same code
  • 44. © 2023 Neo4j, Inc. All rights reserved. Let’s stay connected with the community dev.neo4j.com/chat
  • 45. © 2023 Neo4j, Inc. All rights reserved. Let’s stay connected ghlen@nagels.tech Whatsapp +32 485 49 64 90
  • 46. © 2023 Neo4j, Inc. All rights reserved. © 2023 Neo4j, Inc. All rights reserved. Thank You! Special thanks to: Martin O’Hanlon and Jennifer Reif Questions?