Using Rexter API to interact with Neo4j - neo4j

Is there a way to interact with a neo4j graph db (running externally HA mode) via Rexter API. Neo4j's REST api is great but using Rexter makes my application completely agnostic of the remote graph db implementation stack. This will enable me to swap in other tinkerpop based graph db stacks like titan without affecting/changing my application code.

You should be able to use the Neo4jHaGraph Blueprints implementation:
https://github.com/tinkerpop/blueprints/wiki/Neo4jHa-Implementation
Here's some instructions for connecting using Rexster:
https://github.com/tinkerpop/rexster/wiki/Specific-Graph-Configurations#neo4j-high-availability-cluster

Related

How to use Neo4j bolt driver along with native Java API of an embedded neo4j db?

We have one application built using Neo4j 3.0.4 embedded db. This application is responsible to build Graph.
We have another application built using Spring Data Neo4j 4.1. This application is responsible to get the Graph db data for UI.
As we do not have the capability of using traversal API in SDN4, Is there any possibility to use native Neo4j Java API in SDN4 application?
How can we do that?
There is an embedded driver for neo4j-ogm which SDN is built on, the SDN and OGM docs have examples on how to use it.
http://docs.spring.io/spring-data/data-neo4j/docs/4.2.0.RELEASE/reference/html/#reference:configuration:driver:embedded
You can expose your Neo4j embedded application through the bolt interface (This might be 3.1+ only).
You can then start your SDN application in a separate JVM and connect to your embedded instance using the bolt driver.
Otherwise it is not possible to use an embedded instance controlled by another main and SDN embedded together.

How to query Titan Graph Database from iOS App

If I set up a graph-database with an AWS DynamoDB backend using the Titan plug-in, how do I then actually send queries to the database and return values? From this Diagram that I found here, it looks like the TinkerPop API can be used to send these queries. But I can't find any information on running TinkerPop on an iOS device. So how do I interact with the database from the app?
Thanks.
TinkerPop and Titan are Java libraries, so if you are writing an IOS app, you should go through the TinkerPop Gremlin Server. As described in the TinkerPop documentation,
[Gremlin Server] Provides a method for Non-JVM languages (e.g. Python, Javascript, etc.) to communicate with the TinkerPop stack.... By default, communication with Gremlin Server occurs over WebSockets and exposes a custom sub-protocol for interacting with the server.
In your IOS app, you can connect to the Gremlin Server using a WebSockets client library, such as SocketRocket (Objective-C) or Starscream (Swift). Then you would need to send a RequestMessage to the Gremlin Server following the format described in the TinkerPop documentation. An initial approach to create a Gremlin Driver in Swift has been attempted (gist).
Alhtough WebSockets is the default connection protocol, you can optionally configure HTTP on the Gremlin Server instead, then make HTTP requests to the server.

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).

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.

How to enable Neo4j REST Streaming with spring-data-neo4j

I am using spring-data-neo4j to access the Neo4j database. I want to enable REST streaming for improving the performance of my Neo4j interactions.
Can anyone please guide me on how to leverage streaming via spring-data-neo4j? i.e. How do I tell spring data to send the 'stream=true' header in every REST request to the Neo4j server?
It is already enabled by default.
You can control it by the System property: org.neo4j.rest.stream=true
https://github.com/neo4j/java-rest-binding#configuration-system-properties

Resources