Book Image

Learning Neo4j

By : Rik Van Bruggen
Book Image

Learning Neo4j

By: Rik Van Bruggen

Overview of this book

Table of Contents (18 chapters)
Learning Neo4j
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Where to Find More Information Related to Neo4j
Index

A graph model – a simple, high-fidelity model of reality


Let's take a quick look at how we can avoid the complexity mentioned previously in the graph world. In the following figure, you will find the graph model and the relational model side by side:

The relational model versus the graph model

On the right-hand side of the image, you will see the three tables in the relational model:

  • A customers table with a number of customer records

  • An Accounts table with a number of accounts of these customers

  • A typical join table that links customers to accounts

What is important here is the implication of this construction: every single time we want to find the accounts of a customer, we need to perform the following:

  1. Look up the customer by their key in the customer table.

  2. Join the customer using this key to their accounts.

  3. Look up the customer's accounts in the accounts table using the account keys that we found in the previous step.

Contrast this with the left-hand side of the figure, and you will see that...