hi im new here and this is my first post. im trying to build an app where sharing post between friends and friend of friend
for ex consider this there are users A,B,C and D and each user can create posts.
Now User A and B are friends and User B and C Friends. so if A create a Post, it can be seen by B(friend ) and C (friend of friend). but not by user D.
so is it possible to increase the degree also like if C and D are friends . then can the post created by A can be seen by D (friend of a friend of a friend)
This would be fairly easy with neo4j. You could have a model with nodes for Person and Post. A post can be related to its author with a POSTED_BY relationship. People that are friends can be related with a FRIEND_OF relationship. I would assume the friendship is bidirectional, thus the relationship direction is not relevant. Given a user, you can find all the friends, friend of friends, etc to any depth. Assuming just friend and friend of friends, you can find these for ‘Tom’ with the following, where ‘f’ are the related friends of Tom.
match(n:Person{name:’Tom’})
match(n)-[:FRIEND_OF*2]-(f:Person)
return f
if you want the posts of these related friends, then use the following:
you can increase the degree by increasing the ‘2’ following the asterisk.
This can be done much more efficiently and less complicated than could be done in a relational database. The main reasons being the entities are linked by relationships that can be quickly traversed, compared to a relational database were you have to perform joins for each degree of separation. Performance would degrade quickly and complexity would also increase substantially as the degree increased.
thanks. im a non technical developer. already have my app published without knowing any code entirely developed by me. im using various no code tools. so is there such tools available for neo4j , where i can generate queries,filters and api's