Database Reference
In-Depth Information
In Neo4j, the social graph is typically defined in one of two manners. The first is a direct connection that implies
a mutual connection, which is similar to the approach user connections are made on Facebook. The second approach
is where one user follows another user, similar to the connections created on Twitter. In Figure 3-7 and 3-8 , we can see
how both of these connections methods might be modeled within a relational database.
Figure 3-7. Entity-relationship diagram with mutual connections
Figure 3-8. Entity-relationship diagram with a one-way connection
Figures 3-9 and 3-10 show how the same relationships would be modeled for Neo4j. In Figure 3-9 , the direction is
shown as a single relationship between two nodes. As mentioned earlier in this chapter, you should avoid duplicating
a typed relationship between two nodes. However, this is one exception to the directionality of relationship modeling,
as it is necessary to define whether the relationship is mutual and, indirectly, allows for certain features to be enabled.
 
Search WWH ::




Custom Search