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 de 46

Recomendados

Knowledge Graphs for Network Digital Twins por
Knowledge Graphs for Network Digital TwinsKnowledge Graphs for Network Digital Twins
Knowledge Graphs for Network Digital TwinsNeo4j
143 vistas20 diapositivas
Telecoms Service Assurance & Service Fulfillment with Neo4j Graph Database por
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
123 vistas21 diapositivas
Spark and Deep Learning Frameworks at Scale 7.19.18 por
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 vistas51 diapositivas
Transforming BT’s Infrastructure Management with Graph Technology por
Transforming BT’s Infrastructure Management with Graph TechnologyTransforming BT’s Infrastructure Management with Graph Technology
Transforming BT’s Infrastructure Management with Graph TechnologyNeo4j
323 vistas23 diapositivas
Neo4j: The path to success with Graph Database and Graph Data Science por
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 vistas44 diapositivas
Optimizing Your Supply Chain with Neo4j por
Optimizing Your Supply Chain with Neo4jOptimizing Your Supply Chain with Neo4j
Optimizing Your Supply Chain with Neo4jNeo4j
31 vistas39 diapositivas

Más contenido relacionado

Similar a Road to NODES 2023: Graphing Relational Databases

El camino hacia el éxito con las bases de datos de grafos, la ciencia de dato... por
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
62 vistas49 diapositivas
Mass Scale Networking por
Mass Scale NetworkingMass Scale Networking
Mass Scale NetworkingSteve Iatrou
11 vistas37 diapositivas
The art of the possible with graph technology_Neo4j GraphSummit Dublin 2023.pptx por
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
189 vistas29 diapositivas
The Neo4j Data Platform for Today & Tomorrow.pdf por
The Neo4j Data Platform for Today & Tomorrow.pdfThe Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdfNeo4j
157 vistas53 diapositivas
Data Lineage, Property Based Testing & Neo4j por
Data Lineage, Property Based Testing & Neo4j Data Lineage, Property Based Testing & Neo4j
Data Lineage, Property Based Testing & Neo4j Neo4j
85 vistas13 diapositivas
Workshop - Build a Graph Solution por
Workshop - Build a Graph SolutionWorkshop - Build a Graph Solution
Workshop - Build a Graph SolutionNeo4j
94 vistas61 diapositivas

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

El camino hacia el éxito con las bases de datos de grafos, la ciencia de dato... por 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...
Neo4j62 vistas
The art of the possible with graph technology_Neo4j GraphSummit Dublin 2023.pptx por 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
Neo4j189 vistas
The Neo4j Data Platform for Today & Tomorrow.pdf por 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 vistas
Data Lineage, Property Based Testing & Neo4j por Neo4j
Data Lineage, Property Based Testing & Neo4j Data Lineage, Property Based Testing & Neo4j
Data Lineage, Property Based Testing & Neo4j
Neo4j85 vistas
Workshop - Build a Graph Solution por Neo4j
Workshop - Build a Graph SolutionWorkshop - Build a Graph Solution
Workshop - Build a Graph Solution
Neo4j94 vistas
IRJET- Top-K Query Processing using Top Order Preserving Encryption (TOPE) por 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 vistas
Dagster - DataOps and MLOps for Machine Learning Engineers.pdf por 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 Ong88 vistas
The path to success with graph database and graph data science_ Neo4j GraphSu... por 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...
Neo4j92 vistas
Neo4j GraphSummit London March 2023 Emil Eifrem Keynote.pptx por 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 vistas
PyMADlib - A Python wrapper for MADlib : in-database, parallel, machine learn... por 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 vistas
IRJET- Efficient Geometric Range Search on RTREE Occupying Encrypted Spatial ... por 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 vistas
Neo4j : la voie du succès avec les bases de données de graphes et la Graph Da... por 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 vistas
Show and Tell - Data and Digitalisation, Digital Twins.pdf por 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 vistas
The Art of the Possible with Graph Technology por 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 vistas
Capella Days 2021 | An example of model-centric engineering environment with ... por 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 ...
Obeo254 vistas
CV of Minfeng Hu por Minfeng Hu
CV of Minfeng HuCV of Minfeng Hu
CV of Minfeng Hu
Minfeng Hu146 vistas

Más de Neo4j

Discover Aura Workshop (12.5.23).pdf por
Discover Aura Workshop (12.5.23).pdfDiscover Aura Workshop (12.5.23).pdf
Discover Aura Workshop (12.5.23).pdfNeo4j
15 vistas55 diapositivas
FIMA 2023 Neo4j & FS - Entity Resolution.pptx por
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptxNeo4j
19 vistas26 diapositivas
Operations & Data Graph por
Operations & Data GraphOperations & Data Graph
Operations & Data GraphNeo4j
48 vistas25 diapositivas
TAGTTOO: La nova xarxa social por
TAGTTOO: La nova xarxa socialTAGTTOO: La nova xarxa social
TAGTTOO: La nova xarxa socialNeo4j
27 vistas19 diapositivas
El Arte de lo Possible por
El Arte de lo PossibleEl Arte de lo Possible
El Arte de lo PossibleNeo4j
53 vistas35 diapositivas
Neo4j y GenAI por
Neo4j y GenAI Neo4j y GenAI
Neo4j y GenAI Neo4j
60 vistas41 diapositivas

Más de Neo4j(20)

Discover Aura Workshop (12.5.23).pdf por Neo4j
Discover Aura Workshop (12.5.23).pdfDiscover Aura Workshop (12.5.23).pdf
Discover Aura Workshop (12.5.23).pdf
Neo4j15 vistas
FIMA 2023 Neo4j & FS - Entity Resolution.pptx por Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j19 vistas
Operations & Data Graph por Neo4j
Operations & Data GraphOperations & Data Graph
Operations & Data Graph
Neo4j48 vistas
TAGTTOO: La nova xarxa social por Neo4j
TAGTTOO: La nova xarxa socialTAGTTOO: La nova xarxa social
TAGTTOO: La nova xarxa social
Neo4j27 vistas
El Arte de lo Possible por Neo4j
El Arte de lo PossibleEl Arte de lo Possible
El Arte de lo Possible
Neo4j53 vistas
Neo4j y GenAI por Neo4j
Neo4j y GenAI Neo4j y GenAI
Neo4j y GenAI
Neo4j60 vistas
Roadmap y Novedades de producto por Neo4j
Roadmap y Novedades de productoRoadmap y Novedades de producto
Roadmap y Novedades de producto
Neo4j64 vistas
Neo4j : Graphes de Connaissance, IA et LLMs por Neo4j
Neo4j : Graphes de Connaissance, IA et LLMsNeo4j : Graphes de Connaissance, IA et LLMs
Neo4j : Graphes de Connaissance, IA et LLMs
Neo4j62 vistas
Les nouveautés produit Neo4j por Neo4j
 Les nouveautés produit Neo4j Les nouveautés produit Neo4j
Les nouveautés produit Neo4j
Neo4j32 vistas
Sopra Steria : Analyse intelligente des réseaux dans le domaine des télécommu... por 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 vistas
Generali : SPIDER, notre produit au cœur des enjeux Generali en termes de Com... por 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 vistas
Neo4j Generative AI workshop at GraphSummit London 14 Nov 2023.pdf por 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
Neo4j63 vistas
Neo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptx por 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
Neo4j60 vistas
Neo4j workshop at GraphSummit London 14 Nov 2023.pdf por 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
Neo4j56 vistas
Neo4j Product Updates & Knowledge Graphs at GraphSummit London 14 Nov 2023.pptx por 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
Neo4j68 vistas
AstraZeneca at Neo4j GraphSummit London 14Nov23.pptx por Neo4j
AstraZeneca at Neo4j GraphSummit London 14Nov23.pptxAstraZeneca at Neo4j GraphSummit London 14Nov23.pptx
AstraZeneca at Neo4j GraphSummit London 14Nov23.pptx
Neo4j53 vistas
Google Cloud at GraphSummit London 14 Nov 2023.pptx por 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 vistas
The Art of the Possible with Graph - Sudhir Hasbe - GraphSummit London 14 Nov... por 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 vistas
Northern Gas Networks and CKDelta at Neo4j GraphSummit London 14Nov23.pptx por 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
Neo4j49 vistas
Peek into Neo4j Product Strategy and Roadmap por Neo4j
Peek into Neo4j Product Strategy and RoadmapPeek into Neo4j Product Strategy and Roadmap
Peek into Neo4j Product Strategy and Roadmap
Neo4j88 vistas

Último

Using Qt under LGPL-3.0 por
Using Qt under LGPL-3.0Using Qt under LGPL-3.0
Using Qt under LGPL-3.0Burkhard Stubert
14 vistas11 diapositivas
Ports-and-Adapters Architecture for Embedded HMI por
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMIBurkhard Stubert
35 vistas19 diapositivas
FOSSLight Community Day 2023-11-30 por
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30Shane Coughlan
8 vistas18 diapositivas
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile... por
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...Stefan Wolpers
44 vistas38 diapositivas
Top-5-production-devconMunich-2023-v2.pptx por
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptxTier1 app
9 vistas42 diapositivas
Techstack Ltd at Slush 2023, Ukrainian delegation por
Techstack Ltd at Slush 2023, Ukrainian delegationTechstack Ltd at Slush 2023, Ukrainian delegation
Techstack Ltd at Slush 2023, Ukrainian delegationViktoriiaOpanasenko
7 vistas4 diapositivas

Último(20)

Ports-and-Adapters Architecture for Embedded HMI por Burkhard Stubert
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMI
Burkhard Stubert35 vistas
FOSSLight Community Day 2023-11-30 por Shane Coughlan
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30
Shane Coughlan8 vistas
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile... por Stefan Wolpers
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
How To Make Your Plans Suck Less — Maarten Dalmijn at the 57th Hands-on Agile...
Stefan Wolpers44 vistas
Top-5-production-devconMunich-2023-v2.pptx por Tier1 app
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptx
Tier1 app9 vistas
Streamlining Your Business Operations with Enterprise Application Integration... por Flexsin
Streamlining Your Business Operations with Enterprise Application Integration...Streamlining Your Business Operations with Enterprise Application Integration...
Streamlining Your Business Operations with Enterprise Application Integration...
Flexsin 5 vistas
tecnologia18.docx por nosi6702
tecnologia18.docxtecnologia18.docx
tecnologia18.docx
nosi67026 vistas
Mobile App Development Company por Richestsoft
Mobile App Development CompanyMobile App Development Company
Mobile App Development Company
Richestsoft 5 vistas
Introduction to Git Source Control por John Valentino
Introduction to Git Source ControlIntroduction to Git Source Control
Introduction to Git Source Control
John Valentino8 vistas
Supercharging your Python Development Environment with VS Code and Dev Contai... por Dawn Wages
Supercharging your Python Development Environment with VS Code and Dev Contai...Supercharging your Python Development Environment with VS Code and Dev Contai...
Supercharging your Python Development Environment with VS Code and Dev Contai...
Dawn Wages5 vistas
predicting-m3-devopsconMunich-2023.pptx por Tier1 app
predicting-m3-devopsconMunich-2023.pptxpredicting-m3-devopsconMunich-2023.pptx
predicting-m3-devopsconMunich-2023.pptx
Tier1 app10 vistas
Dapr Unleashed: Accelerating Microservice Development por Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski16 vistas

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?