-1

I have 8 databases in Neo4j and depending on user interaction I need to load them dynamically. I know that I can modify neo4j.conf file for that and restart the database, but how to do that dynamically, say, from node.js?

Nikita Vlasenko
  • 4,004
  • 7
  • 47
  • 87
  • Possible duplicate of [Creating multiple databases on one server using Neo4j](https://stackoverflow.com/questions/25659378/creating-multiple-databases-on-one-server-using-neo4j) – stdob-- Mar 07 '18 at 11:26
  • I do not really need to create them, just switch. – Nikita Vlasenko Mar 07 '18 at 22:55

1 Answers1

1

Have the 8 dbs running alongside and connect to the wanted one on the "right-for-that-user" port when creating the connection to neo in node. I think any other "stop-start other" solution would cause interruption of service and lost data.

I'm curious of the why you have that need, unless you are hosting neo for several companies.

If you want to hide data from different users of the same app. Well, create roles, lock everything and provide custom endpoints.

Jerome_B
  • 1,079
  • 8
  • 15
  • One database is 10Gb, we do not want to keep everything in one huge file. Ultimately there can be up to several hundreds of them. Can the efficiency of neo4j queries suffer if we have one huge database? We have a suspicion that it can. Then, also, just conceptually it would be better to have multiple databases. I think SQL allows that, but neo4j somehow does not. – Nikita Vlasenko Mar 07 '18 at 22:58
  • 2
    queries efficiency in neo4j does NOT depend on the quantity of data but on how the query is written. As per Neo4j's chief architect, Neo4 could manage billions of nodes. But that was before. Now it is unlimited in number (disk space still matters of course). To optimize your queries, EXPLAIN and PROFILE are your friends. – Jerome_B Mar 07 '18 at 23:14
  • 1
    Instant queries start from nodes picked by an index and traverse as few relations from there as possible. Sometimes, refactoring the model is necessary to get better performance. Oh and hardware choice in that matter is important. SSDs of course but the more RAM the better – Jerome_B Mar 07 '18 at 23:18