Database Reference
In-Depth Information
Figure 1.1. Users and their friends represented as a graph data structure
Note
Tobesemanticallycorrect,thefriendshiprelationshipshouldbebidirectional.InNeo4j,bi-
directionality is modeled using two relationships, with one direction each. (In Neo4j, each
relationship must have a well-defined direction, but more on that later.) So you should see
two separate friendship relationships for each pair of friends, one in each direction. For
simplicity we have modeled friendships as single, direct relationships. In chapters 2 and 3
you'll learn why this data model is actually more efficient in Neo4j.
Let's look at the relational model that would store data about users and their friends.
 
Search WWH ::




Custom Search