Chapter 31. Extending Neo4j

Neo4j provides a pluggable infrastructure for extensions. Procedures extend the capabilities of the Cypher query language. Server plugins and extensions allow new surfaces to be created in the REST API. All three require the user to be familiar with the Java programming language and to have an environment set up for compiling Java code.

[Warning]Warning

When running your own code and Neo4j in the same JVM, there are a few things you should keep in mind:

  • Don’t create or retain more objects than you strictly need to. Large caches in particular tend to promote more objects to the old generation, thus increasing the need for expensive full garbage collections.
  • Don’t use internal Neo4j APIs. They may change in future releases, and they might not always work as intended in the context of your code.
  • If possible, avoid using Java object serialization or reflection in your code or in any runtime dependency that you use. Otherwise, if you cannot avoid using Java object serialization and reflection, then ensure that the -XX:+TrustFinalNonStaticFields JVM flag is disabled in neo4j-wrapper.conf.