Road to NODES 2023: Graphing Relational Databases

Neo4j
Neo4jOpen Source NOSQL Graph Database à 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 sur 46

Recommandé

Knowledge Graphs for Network Digital Twins par
Knowledge Graphs for Network Digital TwinsKnowledge Graphs for Network Digital Twins
Knowledge Graphs for Network Digital TwinsNeo4j
143 vues20 diapositives
Telecoms Service Assurance & Service Fulfillment with Neo4j Graph Database par
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
121 vues21 diapositives
Spark and Deep Learning Frameworks at Scale 7.19.18 par
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 vues51 diapositives
Transforming BT’s Infrastructure Management with Graph Technology par
Transforming BT’s Infrastructure Management with Graph TechnologyTransforming BT’s Infrastructure Management with Graph Technology
Transforming BT’s Infrastructure Management with Graph TechnologyNeo4j
323 vues23 diapositives
Neo4j: The path to success with Graph Database and Graph Data Science par
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 vues44 diapositives
Optimizing Your Supply Chain with Neo4j par
Optimizing Your Supply Chain with Neo4jOptimizing Your Supply Chain with Neo4j
Optimizing Your Supply Chain with Neo4jNeo4j
30 vues39 diapositives

Contenu connexe

Similaire à Road to NODES 2023: Graphing Relational Databases

El camino hacia el éxito con las bases de datos de grafos, la ciencia de dato... par
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 vues49 diapositives
Mass Scale Networking par
Mass Scale NetworkingMass Scale Networking
Mass Scale NetworkingSteve Iatrou
11 vues37 diapositives
The art of the possible with graph technology_Neo4j GraphSummit Dublin 2023.pptx par
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 vues29 diapositives
The Neo4j Data Platform for Today & Tomorrow.pdf par
The Neo4j Data Platform for Today & Tomorrow.pdfThe Neo4j Data Platform for Today & Tomorrow.pdf
The Neo4j Data Platform for Today & Tomorrow.pdfNeo4j
157 vues53 diapositives
Data Lineage, Property Based Testing & Neo4j par
Data Lineage, Property Based Testing & Neo4j Data Lineage, Property Based Testing & Neo4j
Data Lineage, Property Based Testing & Neo4j Neo4j
85 vues13 diapositives
Workshop - Build a Graph Solution par
Workshop - Build a Graph SolutionWorkshop - Build a Graph Solution
Workshop - Build a Graph SolutionNeo4j
94 vues61 diapositives

Similaire à Road to NODES 2023: Graphing Relational Databases(20)

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

Plus de Neo4j

FIMA 2023 Neo4j & FS - Entity Resolution.pptx par
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptxNeo4j
17 vues26 diapositives
Operations & Data Graph par
Operations & Data GraphOperations & Data Graph
Operations & Data GraphNeo4j
43 vues25 diapositives
TAGTTOO: La nova xarxa social par
TAGTTOO: La nova xarxa socialTAGTTOO: La nova xarxa social
TAGTTOO: La nova xarxa socialNeo4j
27 vues19 diapositives
El Arte de lo Possible par
El Arte de lo PossibleEl Arte de lo Possible
El Arte de lo PossibleNeo4j
50 vues35 diapositives
Neo4j y GenAI par
Neo4j y GenAI Neo4j y GenAI
Neo4j y GenAI Neo4j
54 vues41 diapositives
Roadmap y Novedades de producto par
Roadmap y Novedades de productoRoadmap y Novedades de producto
Roadmap y Novedades de productoNeo4j
60 vues33 diapositives

Plus de Neo4j(20)

FIMA 2023 Neo4j & FS - Entity Resolution.pptx par Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j17 vues
Operations & Data Graph par Neo4j
Operations & Data GraphOperations & Data Graph
Operations & Data Graph
Neo4j43 vues
TAGTTOO: La nova xarxa social par Neo4j
TAGTTOO: La nova xarxa socialTAGTTOO: La nova xarxa social
TAGTTOO: La nova xarxa social
Neo4j27 vues
El Arte de lo Possible par Neo4j
El Arte de lo PossibleEl Arte de lo Possible
El Arte de lo Possible
Neo4j50 vues
Neo4j y GenAI par Neo4j
Neo4j y GenAI Neo4j y GenAI
Neo4j y GenAI
Neo4j54 vues
Roadmap y Novedades de producto par Neo4j
Roadmap y Novedades de productoRoadmap y Novedades de producto
Roadmap y Novedades de producto
Neo4j60 vues
Neo4j : Graphes de Connaissance, IA et LLMs par Neo4j
Neo4j : Graphes de Connaissance, IA et LLMsNeo4j : Graphes de Connaissance, IA et LLMs
Neo4j : Graphes de Connaissance, IA et LLMs
Neo4j56 vues
Les nouveautés produit Neo4j par Neo4j
 Les nouveautés produit Neo4j Les nouveautés produit Neo4j
Les nouveautés produit Neo4j
Neo4j32 vues
Sopra Steria : Analyse intelligente des réseaux dans le domaine des télécommu... par 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 vues
Generali : SPIDER, notre produit au cœur des enjeux Generali en termes de Com... par 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 vues
Neo4j Generative AI workshop at GraphSummit London 14 Nov 2023.pdf par 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 vues
Neo4j & AWS Bedrock workshop at GraphSummit London 14 Nov 2023.pptx par 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 vues
Neo4j workshop at GraphSummit London 14 Nov 2023.pdf par 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 vues
Neo4j Product Updates & Knowledge Graphs at GraphSummit London 14 Nov 2023.pptx par 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 vues
AstraZeneca at Neo4j GraphSummit London 14Nov23.pptx par Neo4j
AstraZeneca at Neo4j GraphSummit London 14Nov23.pptxAstraZeneca at Neo4j GraphSummit London 14Nov23.pptx
AstraZeneca at Neo4j GraphSummit London 14Nov23.pptx
Neo4j47 vues
Google Cloud at GraphSummit London 14 Nov 2023.pptx par 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 vues
The Art of the Possible with Graph - Sudhir Hasbe - GraphSummit London 14 Nov... par 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 vues
Northern Gas Networks and CKDelta at Neo4j GraphSummit London 14Nov23.pptx par 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
Neo4j47 vues
Peek into Neo4j Product Strategy and Roadmap par Neo4j
Peek into Neo4j Product Strategy and RoadmapPeek into Neo4j Product Strategy and Roadmap
Peek into Neo4j Product Strategy and Roadmap
Neo4j87 vues
Transforming Intelligence Analysis with Knowledge Graphs par Neo4j
Transforming Intelligence Analysis with Knowledge GraphsTransforming Intelligence Analysis with Knowledge Graphs
Transforming Intelligence Analysis with Knowledge Graphs
Neo4j62 vues

Dernier

How Workforce Management Software Empowers SMEs | TraQSuite par
How Workforce Management Software Empowers SMEs | TraQSuiteHow Workforce Management Software Empowers SMEs | TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuiteTraQSuite
5 vues3 diapositives
SAP FOR TYRE INDUSTRY.pdf par
SAP FOR TYRE INDUSTRY.pdfSAP FOR TYRE INDUSTRY.pdf
SAP FOR TYRE INDUSTRY.pdfVirendra Rai, PMP
28 vues3 diapositives
Agile 101 par
Agile 101Agile 101
Agile 101John Valentino
9 vues20 diapositives
JioEngage_Presentation.pptx par
JioEngage_Presentation.pptxJioEngage_Presentation.pptx
JioEngage_Presentation.pptxadmin125455
6 vues4 diapositives
Generic or specific? Making sensible software design decisions par
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsBert Jan Schrijver
6 vues60 diapositives
Bootstrapping vs Venture Capital.pptx par
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptxZeljko Svedic
14 vues17 diapositives

Dernier(20)

How Workforce Management Software Empowers SMEs | TraQSuite par TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuiteHow Workforce Management Software Empowers SMEs | TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuite
TraQSuite5 vues
JioEngage_Presentation.pptx par admin125455
JioEngage_Presentation.pptxJioEngage_Presentation.pptx
JioEngage_Presentation.pptx
admin1254556 vues
Generic or specific? Making sensible software design decisions par Bert Jan Schrijver
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
Bootstrapping vs Venture Capital.pptx par Zeljko Svedic
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptx
Zeljko Svedic14 vues
Ports-and-Adapters Architecture for Embedded HMI par Burkhard Stubert
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMI
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... par NimaTorabi2
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
NimaTorabi215 vues
predicting-m3-devopsconMunich-2023-v2.pptx par Tier1 app
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptx
Tier1 app9 vues
Top-5-production-devconMunich-2023.pptx par Tier1 app
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptx
Tier1 app8 vues

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?