NoSQL Zone is brought to you in partnership with:

Andreas Kollegger is a leading speaker and writer on graph databases and Neo4j and the bridge between community and developer efforts. He works actively in the community, speaking around the world and promoting the larger Neo4j ecosystem of projects. Author of Fair Trade Software, and the lead for Neo4j in the cloud, Andreas plays a valuable role for progressive happenings within Neo4j. Andreas is a DZone MVB and is not an employee of DZone and has posted 64 posts at DZone. You can read more from them at their website. View Full User Profile

Neo4j 1.9.M01 -- Self-Managed HA

10.31.2012
| 3284 views |
  • submit to reddit
Editor's Note: This post was originally written by Peter Neubauer at the Neo4j Blog.

Welcome everyone to the first Milestone of the Neo4j 1.9 
releases! In this release we're introducing a simplification of HA cluster operations, and a set of excellent improvements to our query language, Cypher.

Neo4j HA - fewer moving parts

Setting up a Neo4j High Availability cluster requires configuring a companion coordinator cluster. The coordinator cluster is used for master election, tracking the most recent transaction ID, and discovering the current master.
With Neo4j 1.9 M01, cluster members communicate directly with each other,  based on an implementation of the Paxos consensus protocol for master election. We expect that, when perfected, this simplified approach will provide the same behavior you rely upon now in production, with easier operation.

To find out more about the new setup, look to our docs for an updated overview, operational explanation and a setup tutorial.

DISCLAIMER: This is the first outing for the new HA setup and is intended for evaluation and feedback purposes only. Please do not rely on it in production until Neo4j 1.9.GA.


I made a small setup video, using a simple script for a 3-member cluster running on one machine.
Setting up a local HA cluster in Neo4j 1.9 from Peter Neubauer on Vimeo.

Feedback is, as always, warmly welcomed on the Neo4j Google Group!

CYPHER

New Pattern Matcher

In this release we've added a new pattern matcher in Cypher, that utilizes the bi-directional traversal framework that was introduced in Neo4j 1.8  resulting in significantly improved performance over complex graphs. Cypher now also supports setting properties directly from parameter maps providing a useful syntactic shortcut and more pleasant, readable code. 

WITH SKIP/LIMIT/ORDER BY

In the same way that limiting returned results let's you focus on the data matters, Cypher can now apply functions in the WITH clause to cut the number of processed results, resulting in less graph to process and faster queries. See:


START n=node(3)
MATCH n--m
WITH m
ORDER BY m.name desc
LIMIT 1
MATCH m--o
RETURN o.name



Community contributions to Cypher

Being able to aggregate a number of results into a single value has been a popular feature request in Cypher. To achieve that, we've added a reduce (or fold) operation that allows you to aggregate data as we can see here:

start n=node(...)

return reduce( total=0, x in collect(n) : total + x.fun) as total_fun


Thank you Wes Freeman!

For this release, a huge thanks goes to community contributor Wes Freeman for tirelessly adding new features into the Cypher language.

He contributed the above reduce() function, then also string functions, and fixed the inconsistent head/tail behavior. Wes also updated the Neo4j console (see above) with syntax highlighting and multiline input. It now also works on IE9 too!

Wizard as you are Wes, we hope you enjoy the Kymera Wand remote control from Michael Hunger. Your Neo4j community T-Shirt is on its way!

The Release docs

As always, all changes are contained in the changelog, all Cypher changes can be found here


OK, enough talk. Go get Neo4j 1.9.M01 and let us know what you think. Again, please do not use this release in production. This is exclusively for early access to HA with simplified ops.

Enjoy,

/peter
Published at DZone with permission of Andreas Kollegger, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)