0

In Neo4j, I created the database through the various exercises I'm doing. When I run a query, for example MATCH (n) RETURN (n), until that database that was created in "Christmas of 1914" appears on the screen, making my interface ugly, polluted, loaded with unnecessary objects to work at that moment.

If I work with Northwind, I want to see only Northwind, if I work with Facebook, I just want to see Social, and so on. I do not want to see all the databases on the planet on my screen each time I run a query like MATCH (n) RETURN (n).

Quality Catalyst
  • 6,531
  • 8
  • 38
  • 62
  • Hello Aline. Not sure what you mean with "bank". Can you clarify that ? If you only want to see specific things, you can specify the labels you want to see or create a new database for each set of data that you have (shutdown Neo4j, change the name of the database in neo4j.conf, start again and you have a new one). – Tom Geudens Jun 12 '17 at 20:30
  • Hello Aline! Take a look in [this SO question](https://stackoverflow.com/questions/25659378/creating-multiple-databases-on-one-server-using-neo4j). – Bruno Peres Jun 12 '17 at 20:38
  • 1
    Thanks so much Tom Geudens and specialy Bruno Peres. A solution to what I posted in label creation on all clients, so I'll have a Tom Geudens label and another Bruno Peres label, taking no risk of "leaking information." Or add a special label to each node for a client, eg: ClientName. Or create a root node for each clients database, and always begin the querying at the first node. – Aline Mansur Jun 12 '17 at 21:01

1 Answers1

0

Neo4j doesn't really have a direct equivalent to multiple databases stored within the same server instance. There are three options for achieving this:

1) the closest match would be create run an additional instance of neo4j on the same server. You will need to edit the neo4j.conf file to give the new instance a new port number and a new data directory. This will give you isolation between the data and user accounts in the two databases. The downside is you will need to divide up the RAM on the box before running, effectively limiting both instances to half the RAM.

2) You can attach labels to your nodes to identify which bucket of data (database in the RDBMS world) each node belongs to. You can operate as if the two are isolated even though they really live in the same database instance. Neo4j won't do a lot to help you enforce this, you will need to do the work at the application level. There is a mechanism for you to restrict users to only being able interact with a subset of your graph but you have to write custom procedures and restrict the users to only using those. I haven't tried it but it sounds tedious.

https://neo4j.com/docs/operations-manual/current/security/authentication-authorization/subgraph-access-control/

3) If you are running on VMs or the cloud, you mind as well just create a new instance for your second database. It achieves the same effect as number one but with better isolation of resources.

Ryan Widmaier
  • 7,948
  • 2
  • 30
  • 32
  • RyanW, their answers were of great value, and they validated the suggestions put forward by previous collaborators. Thank you so much for sharing your time with me. – Aline Mansur Jun 13 '17 at 02:50