I have been ponder this question myself, as I am developing a SaaS application that utilizes neo4j. I have come up with three approaches, but I have not yet worked on determine which I will chose. The solution can be a hybrid of more that one approach.
-
Store each user’s graph in a separate database. You can have the database automatically selected for the user by using ‘home databases’ or maintain your own mapping and specify the database when you create the session.
-
Use a customer property on each node searched on and include this in every where clause to match these nodes.
-
Use read/write access roles/permissions by label and add a customer specific label to every node for this customer. The permissions will filter out all nodes that are not labeled with this customer’s unique label.
-
Use a combination of 1 and 2 or 1 and 3.
There are pros and cons to each. Eventually I will prototype each and see which is best.
Does anyone have experience with this? Or additional ideas?