1

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

Vicente
  • 35
  • 5

1 Answers1

0

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.

FrobberOfBits
  • 17,634
  • 4
  • 52
  • 86
  • Hello, thank you very much. This is an example of how I execute a very simple cypher query using the embedded database: 'GraphDatabaseService graphDb; graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(DB_PATH); ExecutionEngine engine = new ExecutionEngine(graphDb); ExecutionResult result = engine.execute("MATCH (c) RETURN c"); System.out.println(result.dumpToString());' Now, I have started the server using the GUI tool (I have installed the windows version). How I query the graph db in my code? How I use the REST services? thank you again, Vicente – Vicente Apr 07 '15 at 13:27
  • I am finally accessing and querying the graph db via REST, with Jersey and I am obtaining Json files with the results, but it is slower than querying it via embedded. My graph has 350.000 nodes and 1.500.000 relationships. I don't know if there is a way for not blocking the db when it is accessed by a user via embedded... thanks – Vicente Apr 08 '15 at 07:53
  • Vicente, your original question is answered. You might consider accepting this, and putting out there a new question so that others can see and help answer. – FrobberOfBits Apr 08 '15 at 15:04