Midsummer madness!
Extending the festive atmosphere of Midsummer here in Sweden (though sadly not the copious amounts of beer and strawberries), we’re releasing the final milestone build of Neo4j 1.4. The celebration includes: Auto Indexing, neat new features to the REST API, even cooler Cypher query language features, and a bunch of performance improvements. We’ve also rid ourselves of the 3rd-party service wrapper code (yay!) that caused us and our fellow (mostly Mac) users in the community so much anguish!Refined Auto Indexing
Having a database manage indexes on behalf of users can be awfully convenient. Recently we announced an early access version of our auto indexing framework that provided a rudimentary way to have indexes managed by convention, rather than explicitly. In this milestone release we’ve incorporated your feedback to provide a much more polished user experience.Map<String, String> config = new HashMap<String, String>();
config.put(Config.NODE_AUTO_INDEXING, “true”);
config.put(Config.NODE_KEYS_INDEXABLE, “name”);
config.put(Config.RELATIONSHIP_AUTO_INDEXING, “true”);config.put(Config.RELATIONSHIP_KEYS_INDEXABLE, “since”);
Now, when a transaction finishes successfully, all primitives are checked for changes on those properties and are added in a dedicated index.
ReadOnlyIndex
Evolving Cypher
The Cypher language query language goes from strength to strength. In this release we now have a powerful (read-only) graph-matching language which can support some pretty sophisticated queries. Here at the Neo4j HQ we’ve had a blast exploring the cineasts.net dataset through Cypher, like so:MATCH (user)-[:FRIEND]-(friend)-[r,:RATED]->(movie)
RETURN movie.title, AVG(r.stars), COUNT(*)
ORDER BY AVG(r.stars) DESC, COUNT(*) DESC limit 7
==> +—————————————————–+
==> | movie.title | avg(r.stars) | count(*) |
==> +—————————————————–+
==> | Forrest Gump | 5.0 | 2 |
==> | The Matrix Reloaded | 5.0 | 1 |
==> | The Simpsons Movie | 5.0 | 1 |
==> | Terminator Salvation | 5.0 | 1 |
==> | The Matrix | 4.8 | 5 |
==> | Meet the Fockers | 4.0 | 1 |
==> | Madagascar: Escape 2 Africa | 4.0 | 1 |
==> +—————————————————–+
==> | 7 rows, 9 ms |
==> +—————————————————–+
Paged Traversers in the REST API
In addition to the batch interface that we released in the previous milestone, the REST API now supports paging traversal results so that clients can iterate through large result sets on the server side, rather than pulling a single, potentially large result set onto the client for processing.Performance improvements
A constant theme (and dev team work package) is to make the database engine smaller, faster, and better. To that end we’ve been busy at work under the hood to squeeze out more performance for the 1.4 release. Highlights compared to Neo4j 1.3 include:- 25% smaller memory footprint so that even more objects can be crammed into the valuable heap space caches.
- Getting typed relationships using node.getRelationships(TYPE,INCOMING/OUTGOING) and getting directed relationships with node.getRelationships(OUTGOING/INCOMING) are around 4x faster due to a new cache implementation.
- Small transactions (e.g. creating a single node) are now also around 4x faster.
- Traversing performance is around 50% better than previously measured.