I use GrapheneDB for hosting my neo4j database (db).
The problem
I have N
clients and am looking for ways to automatically separate their content (their unique db) such that:
Option 1
Since I am unfamiliar with creating new neo4j servers automatically, and want to keep the things simple, my idea is to attach an unique databaseId
to every node
and relationship
in the graph.
Then obviously I would apply queries with that restriction in mind.
Option 2
Another idea would be to create a root node and create a relationship for all nodes with the rootnode.
Questions
My questions are:
N --> /inf
)? My thought is that it will not since you apply the databaseId
restriction (e.g. in noSQL
this works perfectly fine), but I am not sure it will hold as well for a neo4j graph db.As a general suggestion (since I know nothing about your use cases), I would try to use a disjoint set of node labels for each "logical DB" (LDB). That would make it easy to create and access nodes that belong to a specific LDB. And, if you only create relationships between nodes with labels that belong to the same LDB, then graph traversals will also stay within the same LDB.
Neo4j can quickly get nodes by label, and you can also create indexes so that you can find label/property combinations efficiently.