Over the last few months, GraphAware, Neo4j, and Pivotal engineers have been working on a ground-up reimplementation of Spring Data Neo4j (SDN) that is server-first and Cypher-centric. Today we are very excited to announce the first milestone of the new Spring Data project for Neo4j.
Server-first!
While Neo4j has the ability to run embedded or as a regular server-side database, a lot of users favor traditional deployments where the database can scale independently of application servers. Neo4j server has provided the capability to do this for some time now but when the original version of SDN was written, it was designed to target Neo4j in embedded (in-process) deployments.
The new version of SDN changes that. We have completely rewritten Spring Data Neo4j around a single, fast object-graph mapping library for Neo4j, optimised for server-based installations and utilising Cypher via the transactional HTTP Endpoint. In short it is the best version of SDN for Neo4j server.
Focused on performance
We know that Neo4j is very fast database, so we set ourselves the challenge of exceeding the performance of existing SDN (which, remember, runs in-process). Our ambitious aim was to match the existing performance, even over the network. We think we managed it!
To achieve our goal we introduced a number of innovations, including non-reflection based classpath scanning for much faster startup times; variable-depth persistence to allow you to fine-tune requests according to the characteristics of your graph; smart object-mapping to reduce redundant requests to the database, improve latency and minimise wasted CPU cycles; and user-definable session lifetimes, helping you to strike a balance between memory-usage and server request efficiency in your applications.
But even though our focus has been on performance, at the same time we have tried to preserve the APIs that we already know as SDN users (though since we’re using a completely different communication mechanism, there are a few minor differences).
Downloading SDN 4.0 Milestone 1
If you want to give the new Spring Data Neo4j 4.0 Milestone 1 a spin, it is available immediately from the Springframework Milestone Maven Repository:
The documentation can be found here https://docs.spring.io/spring-data/neo4j/docs/4.0.0.M1
And the actual code is here https://maven.springframework.org/milestone/org/springframework/data/spring-data-neo4j/4.0.0.M1
Migrating from previous versions of SDN
If you are an existing SDN user, you should read the section in the documentation on migrating to the new version. While we have tried to keep the APIs consistent with previous versions, there have inevitably been some breaking changes which you will need to know about.
Examples
To make your exploration as pleasant as possible, we ported the classic example Spring Data Neo4j “cineasts” application. You can find the same domain model and service methods just using the new APIs. You can find it on GitHub.
We also created a new, more modern Web-Application, using Angular.js and Spring-Boot, which represents a university administration system, you can create teachers, students, classes and courses. This project is available on GitHub as well.
Tell us what you think!
We’d love to get your feedback on this new version of Spring Data Neo4j. Tell us what you like, as well as what you don’t, or what you’d like to see changed or added. Please bear in mind though that this is the first milestone release, so it may be a little rough in places. You can report your feedback via the project’s issue tracker (assign the issue to 4.0.0.M1) or via the spring-data-neo4j@neotechnology.com feedback email.
Now, a few thank-yous…
As well as the Neo4j engineers and GraphAware team, we’d also like to thank Mark Angrish (aka “Aussie Mark”) who helped significantly with the Spring integration. We also owe a debt of gratitude to Oliver Gierke at Pivotal. We quite literally couldn’t have done it without him.