Road to NODES 2023: Graphing Relational Databases

Neo4j
Neo4jOpen Source NOSQL Graph Database um Neo4j
© 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 von 46

Recomendados

Knowledge Graphs for Network Digital Twins von
Knowledge Graphs for Network Digital TwinsKnowledge Graphs for Network Digital Twins
Knowledge Graphs for Network Digital TwinsNeo4j
143 views20 Folien
Telecoms Service Assurance & Service Fulfillment with Neo4j Graph Database von
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 views21 Folien
Spark and Deep Learning Frameworks at Scale 7.19.18 von
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 Folien
Transforming BT’s Infrastructure Management with Graph Technology von
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 Folien
Neo4j: The path to success with Graph Database and Graph Data Science von
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 Folien
Optimizing Your Supply Chain with Neo4j von
Optimizing Your Supply Chain with Neo4jOptimizing Your Supply Chain with Neo4j
Optimizing Your Supply Chain with Neo4jNeo4j
30 views39 Folien

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... von
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 views49 Folien
Mass Scale Networking von
Mass Scale NetworkingMass Scale Networking
Mass Scale NetworkingSteve Iatrou
11 views37 Folien
The art of the possible with graph technology_Neo4j GraphSummit Dublin 2023.pptx von
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 Folien
The Neo4j Data Platform for Today & Tomorrow.pdf von
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 Folien
Data Lineage, Property Based Testing & Neo4j von
Data Lineage, Property Based Testing & Neo4j Data Lineage, Property Based Testing & Neo4j
Data Lineage, Property Based Testing & Neo4j Neo4j
85 views13 Folien
Workshop - Build a Graph Solution von
Workshop - Build a Graph SolutionWorkshop - Build a Graph Solution
Workshop - Build a Graph SolutionNeo4j
94 views61 Folien

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... von 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 views
The art of the possible with graph technology_Neo4j GraphSummit Dublin 2023.pptx von 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 von 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 von Neo4j
Data Lineage, Property Based Testing & Neo4j Data Lineage, Property Based Testing & Neo4j
Data Lineage, Property Based Testing & Neo4j
Neo4j85 views
Workshop - Build a Graph Solution von 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) von 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 von 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 views
The path to success with graph database and graph data science_ Neo4j GraphSu... von 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 views
Neo4j GraphSummit London March 2023 Emil Eifrem Keynote.pptx von 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... von 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 ... von 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... von 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 von 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 von 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 ... von 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 von Minfeng Hu
CV of Minfeng HuCV of Minfeng Hu
CV of Minfeng Hu
Minfeng Hu146 views

Más de Neo4j

FIMA 2023 Neo4j & FS - Entity Resolution.pptx von
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptxNeo4j
17 views26 Folien
Operations & Data Graph von
Operations & Data GraphOperations & Data Graph
Operations & Data GraphNeo4j
47 views25 Folien
TAGTTOO: La nova xarxa social von
TAGTTOO: La nova xarxa socialTAGTTOO: La nova xarxa social
TAGTTOO: La nova xarxa socialNeo4j
27 views19 Folien
El Arte de lo Possible von
El Arte de lo PossibleEl Arte de lo Possible
El Arte de lo PossibleNeo4j
52 views35 Folien
Neo4j y GenAI von
Neo4j y GenAI Neo4j y GenAI
Neo4j y GenAI Neo4j
56 views41 Folien
Roadmap y Novedades de producto von
Roadmap y Novedades de productoRoadmap y Novedades de producto
Roadmap y Novedades de productoNeo4j
63 views33 Folien

Más de Neo4j(20)

FIMA 2023 Neo4j & FS - Entity Resolution.pptx von Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j17 views
Operations & Data Graph von Neo4j
Operations & Data GraphOperations & Data Graph
Operations & Data Graph
Neo4j47 views
TAGTTOO: La nova xarxa social von Neo4j
TAGTTOO: La nova xarxa socialTAGTTOO: La nova xarxa social
TAGTTOO: La nova xarxa social
Neo4j27 views
El Arte de lo Possible von Neo4j
El Arte de lo PossibleEl Arte de lo Possible
El Arte de lo Possible
Neo4j52 views
Neo4j y GenAI von Neo4j
Neo4j y GenAI Neo4j y GenAI
Neo4j y GenAI
Neo4j56 views
Roadmap y Novedades de producto von Neo4j
Roadmap y Novedades de productoRoadmap y Novedades de producto
Roadmap y Novedades de producto
Neo4j63 views
Neo4j : Graphes de Connaissance, IA et LLMs von Neo4j
Neo4j : Graphes de Connaissance, IA et LLMsNeo4j : Graphes de Connaissance, IA et LLMs
Neo4j : Graphes de Connaissance, IA et LLMs
Neo4j59 views
Les nouveautés produit Neo4j von Neo4j
 Les nouveautés produit Neo4j Les nouveautés produit Neo4j
Les nouveautés produit Neo4j
Neo4j32 views
Sopra Steria : Analyse intelligente des réseaux dans le domaine des télécommu... von 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... von 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 von 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
Neo4j59 views
Neo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptx von 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 von 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
Neo4j54 views
Neo4j Product Updates & Knowledge Graphs at GraphSummit London 14 Nov 2023.pptx von 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 von Neo4j
AstraZeneca at Neo4j GraphSummit London 14Nov23.pptxAstraZeneca at Neo4j GraphSummit London 14Nov23.pptx
AstraZeneca at Neo4j GraphSummit London 14Nov23.pptx
Neo4j52 views
Google Cloud at GraphSummit London 14 Nov 2023.pptx von 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... von 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 von 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 views
Peek into Neo4j Product Strategy and Roadmap von 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 von Neo4j
Transforming Intelligence Analysis with Knowledge GraphsTransforming Intelligence Analysis with Knowledge Graphs
Transforming Intelligence Analysis with Knowledge Graphs
Neo4j62 views

Último

nintendo_64.pptx von
nintendo_64.pptxnintendo_64.pptx
nintendo_64.pptxpaiga02016
6 views7 Folien
Quality Engineer: A Day in the Life von
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the LifeJohn Valentino
7 views18 Folien
Bootstrapping vs Venture Capital.pptx von
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptxZeljko Svedic
15 views17 Folien
Quality Assurance von
Quality Assurance Quality Assurance
Quality Assurance interworksoftware2
5 views6 Folien
Flask-Python.pptx von
Flask-Python.pptxFlask-Python.pptx
Flask-Python.pptxTriloki Gupta
9 views12 Folien
Benefits in Software Development von
Benefits in Software DevelopmentBenefits in Software Development
Benefits in Software DevelopmentJohn Valentino
5 views15 Folien

Último(20)

Bootstrapping vs Venture Capital.pptx von Zeljko Svedic
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptx
Zeljko Svedic15 views
predicting-m3-devopsconMunich-2023-v2.pptx von Tier1 app
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptx
Tier1 app11 views
JioEngage_Presentation.pptx von admin125455
JioEngage_Presentation.pptxJioEngage_Presentation.pptx
JioEngage_Presentation.pptx
admin1254558 views
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... von Lisi Hocke
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Lisi Hocke35 views
Electronic AWB - Electronic Air Waybill von Freightoscope
Electronic AWB - Electronic Air Waybill Electronic AWB - Electronic Air Waybill
Electronic AWB - Electronic Air Waybill
Freightoscope 5 views
Sprint 226 von ManageIQ
Sprint 226Sprint 226
Sprint 226
ManageIQ11 views
360 graden fabriek von info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info33492162 views
Navigating container technology for enhanced security by Niklas Saari von Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy14 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?