Thanks guys. I'm totally aware of the modeling pros of nodes -- sorry I didn't state that more clearly -- but I'm really wondering if there are any *major* cons to removing the direct relationship.
Conceptually yes, more complex queries, but in practice, does it hurt performance of simple "fetch my followers" or "am I following this person" type queries? Up until this point, we *have* maintained both the direct relationship and the node, but we're looking to get rid of this redundancy for simplifying our model. Aseem On Friday, April 18, 2014 4:12:20 AM UTC-4, Michael Hunger wrote: > > Easy answer: it depends > > On your use-cases ... what do you want do do with the graph model. > > And you can actually have both, you have have the simple relationship > spanning across the intermediate node (of course you should keep them in > sync). > > In general, when the relationship is an important enough concept in your > domain, that it has its own name, lifecycle and links to other things then > it makes sense to pull it out as a node. > Also when you want to traverse across that attribute to find other related > nodes that share it (e.g. for recommendation). > > HTH > > Michael > > Am 18.04.2014 um 09:04 schrieb Tom Zeppenfeldt > <[email protected]<javascript:> > >: > > Pros > - you can use the intermediate nodes to link other nodes to, instead of > providing nodeids as values of relationship properties > - it allows you to create a system to "version" networks > > Cons > - longer paths, more complex queries > - managing the rels between the principal nodes is more complex, what is a > rel in "normal" setup, is now a rel-intermediatenode-rel construct > - if you want to make vizualisations, it may be necessary to "skip" the > intermediate nodes, since force-based lay-out algorithms will be disturbed > by the intermediate nodes. > > > On Friday, 18 April 2014 08:47:17 UTC+2, Aseem Kishore wrote: >> >> Example: users following other users. >> >> Is there any advantage/disadvantage to directly connecting users with >> relationships, vs. indirectly connecting them via nodes? >> >> E.g. >> >> (:User) -[:FOLLOWS]-> (:User) >> >> vs. >> >> (:User) <-[:SOURCE_USER]- (:Follow) -[:TARGET_USER]-> (:User) >> >> The node obviously lends more flexibility (e.g. others can "like" it, it >> can be placed in a linked list, etc.), but I'm wondering: are there any >> downsides to it? E.g. if I commonly want to fetch a user's followers, is >> the extra hop a significant performance drain? (I can test performance, but >> I guess I'm wondering if there are other factors I can't even think of.) >> >> Thanks! >> >> Aseem >> >> > -- > You received this message because you are subscribed to the Google Groups > "Neo4j" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
