Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set up In-Memory database instance of Neo4j

Tags:

neo4j

I'd like to run neo4j 2.3 completely in-memory as a standalone executable with a configurable port for test suites. My project's test suites are written in another language (NOT Java!), and will communicate with neo via the HTTP API.

Here is what I've discovered so far:

  • The files in the standard build conf/ directory don't seem to have a way to configure this.
  • There is a class CommunityServerBuilder that a public build method that returns a TestCommunityNeoServer server that is pre-configured to be in-memory.

How would I go about using CommunityServerBuilder to create and run an in-memory neo4j database? Or is there a config property within conf/ that will accomplish the same thing?

like image 532
soundly_typed Avatar asked Dec 19 '25 06:12

soundly_typed


1 Answers

You can set up a temporary in-memory filesystem (sometimes called a "RAM disk") and point your neo4j server to that (or a "subdirectory") for the DB location.

On Linux, you have several choices for setting up a RAM disk, including ramfs and tmpfs. Here is a write-up.

On OSX, there is a nice script for mounting a RAM disk. In the Finder, the RAM disk shows up as a device (probably with the name of "untitled") in the Devices list.

On Windows, there are many commercial packages for creating RAM disks, but this article shows how to use a free tool.

like image 198
cybersam Avatar answered Dec 21 '25 21:12

cybersam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!