Search code examples
javaneo4jcypherserver-mode

Neo4j Server Mode in Java


I have developed a Java application using Neo4j. Basically the user is able to write a cypher query and obtain some results from the graph database. The problem is that it just can access to the graph database one user at a time. And I need the graph database to be accessed by more users at a time. I am accessing the graph db using embedded mode, via Neo4j API for Java. But I have read that it can be possible to access de graph db by more than one user at a time using Neo4j in Server Mode.

I don't know how to start Neo4j in server mode, using Neo4j API for Java. And then executing the application by more than one user at a time.

Thank you,

Vicente


Solution

  • From the command line, you just need to run neo4j start. See the documentation here for more details.

    If you've installed the windows version, it comes with a handy GUI tool that starts and stops the server for you, without the command line. If you're on a Mac or on linux, you'll probably want to run neo4j start or you'll want to set up an init script to do this for you.

    Note that servers work differently than embedded databases; generally your server will run on http://localhost:7474/ and will be accessible via REST services, and not via the regular java API.