Movies Webapp
For this quick demo, we use the example Movies application which is available for many programming languages from our developer resources. The application is just a plain Java webapp that serves three JSON endpoints to a simple Javascript frontend page. The backend connects to Neo4j via JDBC to retrieve the requested information via our Cypherquery language. To prepare for running our app, just download, unzip and start Neo4j, open it onhttps://localhost:7474/ and run the:play movies
statement in the Neo4j browser.
Then we can get and build the application and run it.
To test that it works, open the app in your browser at https://localhost:8080
git clone https://github.com/neo4j-contrib/developer-resources cd developer-resources/language-guides/java/jdbc mvn compile exec:java -DmainClass="org.neo4j.example.movies.Movies"
Setup with XRebel
To use XRebel we just download it, get an eval license and attach the jar as a java-agent to our application.
MAVEN_OPTS=”-javaagent:$HOME/Downloads/xrebel/xrebel.jar” mvn compile exec:java -DmainClass=”org.neo4j.example.movies.Movies”
If we check our example application page again, we see a small green XRebel icon in the left corner.
It provides access to the XRebel UI which has tabs for application performance, database queries, exceptions and more.

For our initial query for the “Matrix” movie, it shows both the request time for the web-application, as well as the database calls to Neo4j.
Interestingly both the JDBC level as well as the underlying http calls to Neo4j are displayed.

If we uglify our app, that our queries are executed incorrectly, simulating a n+1 select, then that shows clearly up in XRebel as massive database interaction.

Runtime Exceptions due to a programming error are also made immediately accessible from the XRebel UI.
For non-visual REST-services you can access the same profiling information via a special endpoint that is added to your application, in our case: https://localhost:8080/xrebel
As you can see, XRebel can give you quick insights in the performance profile of your Neo4j backed application and highlights which queries / pages / secondary requests
need further optimization.