Small-scale in-memory graph Database in Java

2.9k views Asked by At

I'm planning to write a Java application wich relies on a small (Around 3000 nodes) graph to represent its structure. The data should be loaded from a custom file at startup to create an in-memory graph database. I've looked into Neo4j but saw that you can't make it run directly as in-memory. Googling around a bit I found Google JIMFS (Java in-memory file system) may suit my needs.

  • Does anyone have experience with getting Neo4j to work on a JIMFS FileSystem?
  • Are there more suited alternatives wich work in Java (possibly in-memory out of the box like HSQLDB) for small-scale graphs and still provide a declarative query language like Cypher?

Note that performance is not so much of an issue to me, it's more of a playground to gather some experience with graph databases, but I don't want the application to create a Database file system on disk.

2

There are 2 answers

0
František Hartman On BEST ANSWER

Note that performance is not so much of an issue to me,

In that case you can go for ImpermamentGraphDatabase of neo4j, which is created like this:

graphDb = new TestGraphDatabaseFactory().newImpermanentDatabase();

It doesn't create any files on filesystem.

Source:

http://neo4j.com/docs/stable/tutorials-java-unit-testing.html

1
Pumpkin On

I don't know why you wouldn't want the application to create a Database file system on disk but I can easily tell that there are many options. I used neo4j and for most cases found its query methodology clear and visualizer very useful, thereby in my limited knowledge, make it my number one choice. However considering your requirements you might find this interesting :

https://bitbucket.org/lambdazen/bitsy/wiki/Home