edgeryders / graphryder-api

Backend of Graphryder, a software for semantic social network analysis.
https://edgeryders.eu/t/9517
GNU Lesser General Public License v3.0
2 stars 1 forks source link

Make this software aware or capable of multiple datasets in Neo4j #22

Open tanius opened 5 years ago

tanius commented 5 years ago

As reported by @aerugo :+1:

each installation of Graphryder API needs its own Neo4j instance. The community edition of Neo4j can’t handle more than one graph at a time. This means that we need to run multiple instances of Neo4j on the same server. This adds a lot of overhead, as Neo4j is a pretty expensive piece of software to run, especially from a memory point of view.

In light of this, I think it is a priority to rewrite the Graphryder API to use the same Neo4j database for multiple instances. This shouldn’t be incredibly difficult. What we need to do is to somehow label every node and relationship as belonging to a certain sub-graph. Another, more “graphy” way of doing it that might be more canonical for Neo4j would be to introduce the new node type “project” and create a “belongs_to” relationship from that project to all its associated nodes. This is is a more memory-efficient way to do it in a graph database since the relationships are all direct memory pointers from the first object, the only search operation is to get a node from a very small set of indexed project nodes.

So basically an equivalent to tablename prefixes in SQL. There are two ways to implement this: