How to connect to neo4j server in spring via rmi? - neo4j

How to connect to neo4j server in spring via rmi? I found http://mvnrepository.com/artifact/org.neo4j/neo4j-remote-graphdb. Is it component neo4j-remote-graphdb supported?

You can connect with that library, which is also in http://github.com/neo4j/java-rest-binding
But you shouldn't use individual operations over the wire for higher performance operations, use Cypher instead (using RestGraphDatabase.query(query, params)) with Cypher Parameters.

Related

Spring Data Neo4J - Create new nodes via REST endpoint

Does Spring Data provide a way to create new nodes via a REST endpoint? I don't think so but would like to make sure.
Which version are you referring to?
SDN works in both versions also with Neo4j server but using the Cypher Endpoint under the hood.

Neo4j OGM library with embedded server

Is it possible to use the OGM library with one embedded server ?
The examples I have seen so for the session is always obtain via remote http connection to the neo4j server.
I would like to have the elegant programming model of the OGM library without the having the make network IO to the database.
Thank you, kindly
Oscar
The current release of the OGM (1.1.4) supports only the Neo4j remote server.
OGM 2.0 will provide support for Neo4j remote server (http) and embedded Neo4j. Once Neo4j 3.0 is released, OGM 2.x will support the new binary (Bolt) protocol as well.
The first milestone of OGM 2.0 is expected within the next two weeks.

Social Networking Site with Grails and Neo4j

I am developing a social networking website with Grails and MYSQL DB. But I am planning to move to Neo4j DB. Grails supports complete GORM features with MYSQL. But I am sure about the same features in Neo4j. There is a Grails plugin for Neo4j which does not support some of the features that is required to support big websites. So I am planning to use the native Neo4j API. From Grails how to connect to Neo4j DB? There are two scenarios in my case.
Case 1:
Neo4j server is up and running. How to connect and perform the database transactions?
Case 2:
Neo4j server is not running. How to connect and perform the database transactions? I was able to connect using GraphDatabaseService class. But why would one need to connect to DB which is not running. What is this class GraphDatabaseService particularly used for?
I want to use the native Neo4j API to get access to maximum features. Is there a better approach to build the application.
The Grails Neo4j GORM plugin in version 2.0.0.M01 is able to run embedded mode only - so the JVM running the Grails applications spawns the database inside the same JVM. Next milestone (M02) will add support for accessing Neo4j via REST.
In case you don't want to transparently use the GORM methods to talk to Neo4j you can always use direct access by emitting Cypher statements or accessing GraphDatabaseService directly (only on embedded mode of course).

Spring Data Neo4j load balancing

I'm working on an application using Spring Data Neo4j that works with an embedded Neo4j Server. I would like for my application to be able to work with a cluster containing 3 Neo4j nodes, one of this nodes being the embedded server.
I am trying to accomplish some sort of load balancing within the cluster: 1. round-robin requests on each server or 2. write requests on the master embedded server and read requests on the other two servers.
Does Spring Data Neo4j have any kind of load balancing mechanism out of the box? What configuration is necessary to achieve this? Do I need additional tools like HAProxy or mod_proxy? Is there any example of how they can be integrated with the Neo4j cluster and Spring Data Neo4j?
A load balancer component is not part of Neo4j nor part of Spring Data Neo4j. For a sample setup using Neo4j as server is documented at http://docs.neo4j.org/chunked/stable/ha-haproxy.html.
Since your application uses SDN in embedded HA mode, you need to expose the status of your local instance (master or slave) yourself to achieve the same like /db/manage/server/ha/master does in server mode. You might use HighlyAvailableGraphDatabase.isMaster() in your implementation.

Runs multiple web application with same embedded neo4j db

It is required to run multiple application on same neo4j db. But when I try to do that, I am meeting a problem about locking.
Neo4j is locking itself when an application is using it. Multiple application can't be run.
The exception is like,
Unable to lock store [/opt/neo4j-lojika-db/neostore.relationshiptypestore.db.names], this is usually a result of some other Neo4j kernel running using the same store
Is there a way to run multiple web application with same embedded neo4j db.
Thank you!
You can't do this way. You have two options
Use Neo4j HA or
Run Neo4j in server mode rather than embedded mode. If your application is simple then you can use the REST api provided by Neo4j out of box. If your service layer is more involved then, put a service layer on top of a single Neo4j embedded instance and let each application talk to Neo4j through this service layer.

Resources