marc
marc

Reputation: 2187

Proper way to store graphs with Neo4J

I'm building a system which allows the user to call N number of different graphs through an API. Currently I have a working prototype which pulls graphs from CouchDB. However, for obvious reasons, I would like to move to a graph DB. My understanding is that Neo4J can only handle one graph at a time or requires so sort of tagging system to not mix graphs. Neither of those approaches seem optimal. What's the best practice approach for this?

A few more things to note: I will be calling these graphs and manipulating them with something like networkx, and I've considered storing the graphs in a "regular" DB then moving them to Neo4J as the requests come in, which seems pretty intense.

Upvotes: 0

Views: 99

Answers (1)

Stefan Armbruster
Stefan Armbruster

Reputation: 39915

Neo4j does not have a concept of multiple databaseslike most relational databases do using CREATE DATABASE. In Neo4j there is one graph space which you can use.

So you have 2 options:

  1. use seperate Neo4j instances (single or clustered) for each graph, maybe using Neo4j in embedded mode is helpful here
  2. use one Neo4j instance (single or clustered) and store your data in distinct subgraphs. If the subgraphs need some interconnections you can use labels to identify to which subgraph a certain node belongs.

Upvotes: 1

Related Questions