Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create separate Neo4j databases on the same machine?

I'm building a Rails app using Neo4j and the Neo4j.rb gem.

I've started the process of setting up some tests and have not been able to figure out how to keep my test database separate from the one I use in development.

I'd like to keep my development and test data separate, so as to have better test integrity and speed.

Is something like this possible? If so, what sort of configuration/settings would I have to set up?

Thanks.

like image 698
John K. Ferguson Avatar asked Jun 07 '14 02:06

John K. Ferguson


1 Answers

Since Neo4j.rb 3.0 RC1, released at the beginning of September, you're able to specify separate test and development ports. Multi-tenancy isn't supported by Neo4j, so you end up starting two databases. See https://github.com/neo4jrb/neo4j/wiki/How-To-Test for info on setting this up, it's very easy. There are rake tasks for configuration.

A good practice, BTW, is to also set your development port to something other than the default using the rake tasks. It helps protect you from accidentally running tests from another project or starting a different project's dev environment and writing a foreign database.

like image 151
subvertallchris Avatar answered Sep 22 '22 16:09

subvertallchris