Using an external (standalone) Neo4j server

Showing 1-12 of 12 messages
Using an external (standalone) Neo4j server Reuven M. Lerner 5/3/11 5:07 AM
Hi, everyone.  I'm new to Neo4j, and am using it on a site for a
client.  So far, I'm pleased and impressed.  Thanks to everyone
working on the Ruby driver, as well as the Rails support.

I'm wondering if it's possible to use Neo4jrb in a Rails application
(under JRuby, of course), but without the integrated Neo4j server.
That is, when I type "rails s", I currently get both a Rails server
and a Neo4j server.  I'm expecting that we will eventually want to
have our Rails server running on a separate machine from the Neo4j
server, and for them to communicate over the network.  Also, I'd like
to run both my Rails server and my Rails console at the same time,
without having one of them in read-only mode.  Setting
config.neo4j.storage_path to a URL, which I had sorta hoped would
work, didn't.

I'm sure that there's a relatively easy way to turn off the built-in
Neo4j server and to connect to an external server -- but would someone
please tell me how?  (And if there are any serious reasons not to do
this, please let me know.)

Thanks,

Reuven
Re: Using an external (standalone) Neo4j server ronge 5/3/11 10:39 AM
Hi

The options are either you use the embedded neo4j.rb with JRuby or
you use the neo4j server and talking HTTP/Rest with it
(http://wiki.neo4j.org/content/Using_the_Neo4j_Server_with_Ruby)
Neo4j.rb does not have any bindings to the neo4j server (Neography does).


I agree it is annoying that the rails console only works in read only
mode if the server
is already running !
If you want to run several rails-neo4j instances at the same time, check this:
http://neo4j.rubyforge.org/guides/ha_cluster.html
Btw, why do you want to run the rails server and neo4j on different machines ?

Cheers
Andreas> --
> You received this message because you are subscribed to the Google Groups "neo4jrb" group.
> To post to this group, send email to neo...@googlegroups.com.
> To unsubscribe from this group, send email to neo4jrb+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/neo4jrb?hl=en.
>
>

Re: Using an external (standalone) Neo4j server Reuven M. Lerner 5/3/11 10:14 PM

On May 3, 8:39 pm, Andreas Ronge <andreas.ro...@gmail.com> wrote:

> The options are either you use the embedded neo4j.rb with JRuby or
> you use the neo4j server and talking HTTP/Rest with it
> (http://wiki.neo4j.org/content/Using_the_Neo4j_Server_with_Ruby)
> Neo4j.rb does not have any bindings to the neo4j server (Neography does).

If I understand you correctly, you're saying that if I want to enjoy
the ActiveModel stuff that comes with neo4j.rb, then I have to use it
with JRuby and the embedded server?


>
> I agree it is annoying that the rails console only works in read only
> mode if the server
> is already running !

Yeah, this is a really big annoyance for me, and probably the main
reason why I want to have a separate server running.  I'm a very heavy
console user, and hate having to bring things up and down just to play
with things in the console.  Being able to use 1.9.2 rather than JRuby
is also appealing, especially given that I have a lot of experience
deploying standard Rails apps, and very little deploying JRuby apps.

> Btw, why do you want to run the rails server and neo4j on different machines ?

Over time, I expect that we'll need multiple Web servers running
against a single Neo4J server -- just as you do when scaling a Web app
that uses a relational database.

Reuven
Re: Using an external (standalone) Neo4j server ronge 5/3/11 11:46 PM
On Wed, May 4, 2011 at 7:14 AM, Reuven M. Lerner <reu...@lerner.co.il> wrote:
>
> On May 3, 8:39 pm, Andreas Ronge <andreas.ro...@gmail.com> wrote:
>
>> The options are either you use the embedded neo4j.rb with JRuby or
>> you use the neo4j server and talking HTTP/Rest with it
>> (http://wiki.neo4j.org/content/Using_the_Neo4j_Server_with_Ruby)
>> Neo4j.rb does not have any bindings to the neo4j server (Neography does).
>
> If I understand you correctly, you're saying that if I want to enjoy
> the ActiveModel stuff that comes with neo4j.rb, then I have to use it
> with JRuby and the embedded server?
Yes. In neography you get almost the same syntax as for the
Neo4j::Node and Neo4j::Relationship but no ActiveModel stuff.

>
>
>>
>> I agree it is annoying that the rails console only works in read only
>> mode if the server
>> is already running !
>
> Yeah, this is a really big annoyance for me, and probably the main
> reason why I want to have a separate server running.  I'm a very heavy
> console user, and hate having to bring things up and down just to play
> with things in the console.
Ok, I will see what I can do.

> Being able to use 1.9.2 rather than JRuby
> is also appealing, especially given that I have a lot of experience
> deploying standard Rails apps, and very little deploying JRuby apps.

Yes, using 1.9.2 and deploying on heroku is hard to beat.
But if you got a capistrano script it is also just one line to do the
deployment.
I'm currently using vps.net cloud for some projects and it does not
take too long time to configure the machine and capistrano script.

>
>> Btw, why do you want to run the rails server and neo4j on different machines ?
>
> Over time, I expect that we'll need multiple Web servers running
> against a single Neo4J server -- just as you do when scaling a Web app
> that uses a relational database.
One interesting alternative is deploying several Rails servers bundled
with embedded HA enabled Neo4j instances.


>
> Reuven
>
> --
> You received this message because you are subscribed to the Google Groups "neo4jrb" group.
> To post to this group, send email to neo...@googlegroups.com.
> To unsubscribe from this group, send email to neo4jrb+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/neo4jrb?hl=en.
>
>

Re: Using an external (standalone) Neo4j server Krasimir Angelov 5/4/11 12:53 AM
So even if you run HA cluster, all these (RoR app and neo4j instances) will run on same machine? is this correct or I'm getting it wrong?
Re: Using an external (standalone) Neo4j server ronge 5/4/11 12:58 AM
No, you would typically run it on different machines and have a load
balancer in front of it like Apache.

> --
> You received this message because you are subscribed to the Google Groups
> "neo4jrb" group.
> To post to this group, send email to neo...@googlegroups.com.
> To unsubscribe from this group, send email to
> neo4jrb+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/neo4jrb?hl=en.
>

Re: Using an external (standalone) Neo4j server ronge 5/4/11 1:01 AM
Sorry I think I misunderstood you. You should run the RoR app and the
embedded neo4j instance in the same process/machine
but you will have several machine running RoR app each with an
embedded HA Neo4j db.
Re: Using an external (standalone) Neo4j server Krasimir Angelov 5/4/11 1:49 AM
So I may have few machines, each one running both Rails app and embedded Neo4j instance, but all these Neo4j instances will be in HA cluster. Correct?
Re: Using an external (standalone) Neo4j server ronge 5/4/11 3:12 AM
Yes, they all will be in a cluster so that the database will be synchronized.

> --
> You received this message because you are subscribed to the Google Groups
> "neo4jrb" group.
> To post to this group, send email to neo...@googlegroups.com.
> To unsubscribe from this group, send email to
> neo4jrb+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/neo4jrb?hl=en.
>

Re: Using an external (standalone) Neo4j server ronge 5/4/11 3:22 AM
>> I agree it is annoying that the rails console only works in read only
>> mode if the server
>> is already running !
>
> Yeah, this is a really big annoyance for me, and probably the main
> reason why I want to have a separate server running.  I'm a very heavy
> console user, and hate having to bring things up and down just to play
> with things in the console.

I think the best and easiest solution would be to have a console page
visible in your rails application.
Maybe one can even steal some of the code from IRB and expose that as
a web page ?
Who wants to implement this :-)

Another alternative, which I think is more complicated, is running the
embedded database as an HA instance.
Then the rails console start up with a HA enabled neo4j.rb.

Re: Using an external (standalone) Neo4j server Krasimir Angelov 5/4/11 6:57 AM
Cool. Thanks for the answers.
Re: Using an external (standalone) Neo4j server Krasimir Angelov 10/20/11 3:47 AM
Here's something I saw lately - http://devender.wordpress.com/2011/10/17/neo4j-running-embedded-server-with-webconsole/

Can it help somehow? May be not for rails console but for using the webconsole...