Over a million developers have joined DZone.

Neo4j 1.9.M01 -- Self-Managed HA

DZone's Guide to

Neo4j 1.9.M01 -- Self-Managed HA

· Database Zone
Free Resource

Whether you work in SQL Server Management Studio or Visual Studio, Redgate tools integrate with your existing infrastructure, enabling you to align DevOps for your applications with DevOps for your SQL Server databases. Discover true Database DevOps, brought to you in partnership with Redgate.

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!


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. 


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
ORDER BY m.name desc
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.



It’s easier than you think to extend DevOps practices to SQL Server with Redgate tools. Discover how to introduce true Database DevOps, brought to you in partnership with Redgate


Published at DZone with permission of Andreas Kollegger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}