User friend relations

Just a small question to the graph DB experts out there:

What is the best way to separate confirmed and unconfirmed friendships in neo4j? As the relations are only unidirectional I see three ways:

1) Use one single relation and add a flag like “isConfirmed”

2) Use two relations: A and B are friends as soon the relations A->B AND A<-B exist

3) Use two different types of relation: “RequestdFriendship” and “IsFriendOf”. So as soon as the request is confirmed I would delete the RequestedFriendship and create IsFriendOf which direction will be ignored.

So what is the most performant way?

This entry was posted in Structure and tagged , , . Bookmark the permalink.

2 Responses to User friend relations

  1. Rene says:

    I thought we wanted to make directed friendships anyway. So we only follow people and don’t need this friendship request!

    if we stay with relations I would use two different relation ship types but NOT delete the request after a friendship is established. for friend recommendations it is interesting to know who initiated a friendship

  2. Jonas says:

    Yes that came to my mind as soon as I’ve pressed return ;-) So when I import the old metalcon mysql data to neo4j I create bidirectional relations by two “likes” relations per friendship.

    Do we need a special relationship like “isFriendOf” or can we use “likes” as we need for band etc. I think we’ve discussed this already and I think we said that we need a special relation but I’m not sure.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>