We’re on the fast track to the next major Neo4j release, “Kiruna Stol”. With today’s milestone, we’ve added some brand new features, some experimental aspects that we’re looking for feedback on and of course numerous enhancements to everyone’s favorite graph database.
Cypher – An expressive graph query languageTo allow expressive and efficient querying of the graph store without having to write traversers in code, we’re releasing the first iteration of a new query language, code-named “Cypher”.
Cypher is designed to be a humane query language, suitable for both developers and (importantly, we think) operations professionals who want to make ad-hoc queries on the database. Its constructs are based on English prose and neat iconography, which helps to make it (somewhat) self-explanatory.
For example, here’s a query which finds a user called John in an index and then traverses the graph looking for friends of John’s friends (though not his direct friends) before returning both John and any friends-of-friends that it found.
The Cypher documentation is growing even at this early stage, available in its own section of the Neo4j Manual.
This is how it looks in the webadmin console:
Batch-oriented REST APIThe Neo4j Server now contains a new (and experimental) REST API to support batching of REST operations. With this API it’s possible to upload many commands to the database simultaneously and have them executed as part of a single transaction – reducing both network and transactional overheads.
The API is activated by POSTing JSON encoded requests to http://…/db/data/batch
An example HTTP entity body for the request is shown below, containing a list of commands to execute:
Documentation and TutorialsThe Neo4j documentation project continues at pace. The site at http://docs.neo4j.org has become the authoritative place for all Neo4j documentation, some of which is even being generated automatically from running code to ensure it’s up to date and consistent.
To help get to grips with Neo4j, we’re also publishing tutorials to the docs site, so get stuck in!
Faster, Better, SmarterAs always, we’ve looked for opportunities to make our footprint smaller and our code run faster. In this iteration, we’ve lowered the memory profile of nodes, relationships and properties so they use less of that valuable heap space. Also, the BatchInserterIndex now keeps its memory usage in-check with batched commits of indexed data using a configurable batch commit size.
With the addition of relationships that can refer to the same start and end node (loops), we gained significant modelling expressivity. In this milestone we’ve shrunk the memory overhead on loop relationships so that it only takes up extra space for those nodes that actually have loops on them.
For traversals, we’ve built in some caching optimizations that yield useful traversal performance improvements. For even more performance (and less memory overhead), we’ve also removed some unnecessary checks and object allocations during traversal.
Bug BashingWe’ve been busy refining the code and ironing out kinks in this iteration. We’ve fixed several issues that can arise in highly concurrent scenarios, together with a list of fixes for other annoyances that we think will add real value for our community:
- Database locks are now released on Transaction afterCompletion(). This means that database objects can be used as monitors in a distributed environment such as HA setups.
- Added directions on how to configure garbage collection logging.
- Fixed a bug where the RRDB (the store where metrics data is kept) was not shutdown properly, causing problems on Windows machines.
Start your engines!The release is now available in Maven central, and bundled up on the Web ready to download here.
Your Neo4j team and Andres “Cypher” Taylor.