Reputation: 5854
I'm trying to create a model which allows users to navigate between positions (nodes) using various techniques (edges). Basically to traverse the positions graph using their own specific edges, which are unique and available just for them.
I want every user to be able to create their own edges(techniques) between nodes (positions). I've considered having technique edges to all have the same name/type - something like "LEADS_TO", but their properties will be different (name, description and most importantly, reference to user who is allowed to use the edge - basically a creator of that edge).
This means that during graph traversal, I'll have to filter only edges which have the the createdBy
property matching with the userId
.
Also, this model expects that if there will be 1000 users using the app, there will likely be 1000 unique edges (techniques) between 2 nodes (positions).
Would this be correct approach or is my graph thinking/understanding conceptually wrong? Thanks!
Upvotes: 0
Views: 32
Reputation: 7478
There are 3 ways to do what you want :
user_id
that is a string. So like you said you will have multiple edges between your nodes pos1
& pos2
(on for each user)user_id
that is an array of string. So you will have one edge between your nodes pos1
& pos2
, but the size of the array will match the number of useruser_id
: USER_2_LEADS_TO
The choice depends on the type of your queries and also on hte volumetry, ie the average number of relationship you will have between your nodes pos1
& pos2
.
As a first approach, your choice is good.
Cheers
Upvotes: 1