Multiple databases/instances in neo4j

1,959 views
Skip to first unread message

Joe Zhang

unread,
Aug 15, 2013, 4:31:38 PM8/15/13
to neo4j
Dear list:
 
I'm sure some variation of the question has been asked before, but I want to make sure I understand the bigger picture.
 
1. With the advent of Neo4j 2.0, it is quite possible/convenient to store multiple graphs in the same database, using labels.
 
2. Neo4j only supports one database per instance at this point.
 
3. If I really need multiple databases (e.g., separating dev and production DB), I'd have to
  - install multiple instances
  - each instance runs on different port and stores data in different directory
 
Is my understanding above correct?
 
In the 3rd case, is there going to be any resource conflict issue if the multiple instances run on the same machine?
 
Thanks much.
 
Joe

Joe Zhang

unread,
Aug 16, 2013, 2:35:28 PM8/16/13
to neo4j
The questions are quite important to me. In particular the 3rd: is neo4j thread safe?
 
Can sombody help?

Wes Freeman

unread,
Aug 16, 2013, 2:53:59 PM8/16/13
to ne...@googlegroups.com
I would say yes, you can do that (run prod/dev on the same box). I would also not recommend it. If you blow something up in dev and it kills io/cpu, you're going to hurt your prod. Sounds risky to me. Also, you'd need to be careful with your memory settings for heap/mmio/etc.. I routinely run many (10+) dev databases on the same server, for example, without issue.

The thread safe question doesn't seem to be related to #3? The two servers would be running in separate processes on different files--I don't see why it would matter if it weren't thread safe internally (which it is, you can submit several simultaneous requests and if they don't lock each other, they can be executed in separate threads simultaneously on the server--it's sort of an implementation detail, though, imo).

Wes

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Joe Zhang

unread,
Aug 17, 2013, 12:23:07 AM8/17/13
to neo4j
Are 1 and 2 correct then?

Michael Hunger

unread,
Aug 17, 2013, 3:28:08 AM8/17/13
to ne...@googlegroups.com
Yes, Neo4j is thread safe.

Michael


Michael Hunger

unread,
Aug 17, 2013, 3:32:28 AM8/17/13
to ne...@googlegroups.com
1 .Labels can help you to separate graphs.
2. Yes, right now there are no plans on the roadmap to have a different "databases" per instance.
3. You wouldn't want to run dev and production instance in one server anyway, you don't want your dev instance affect your production instance. I would run them on separate machines. If you _have_ to run them on the same machine, do as you said.


--

Joe Zhang

unread,
Aug 18, 2013, 12:53:07 AM8/18/13
to neo4j
Thanks.

Spencer Kohan

unread,
Jun 4, 2014, 6:33:00 PM6/4/14
to ne...@googlegroups.com
For anyone else out there running into this issue: 

I also ended up with a use case where I wanted to have multiple neo4j instances running on the same box for testing.  I ended up putting together this simple node module to streamline the process:

Reply all
Reply to author
Forward
0 new messages