By Neo4j Staff | January 12, 2012 download, and you can try it out right now on Heroku. Enjoy!
If you look up entities (nodes or relationships) using an external key, you’ll want exactly one entity to correspond to each value of the key. For example, if you have nodes representing people, and you look these up using Social Security Number (SSN), you’ll want exactly one node for each SSN. This is easily achieved if you load all your data sequentially, because you can add a new node each time you meet a value of the key (a new SSN). However, up to now, it has been awkward to maintain this uniqueness when multiple processes are adding data simultaneously (via web requests for example).
Since this is a common use-case, we’ve improved the API to make it easy to enforce entity uniqueness for a given key-value pair. At the index level, we’ve added a new method
putIfAbsentwhich ensures that only one entity will indexed for the key-value pair, even if lots of threads are using the same key-value pair at the same time. Alternatively, if you’d prefer to work with nodes or relationships rather than with the underlying indexes, there’s a higher level API provided by
UniqueFactory. This makes it easy to retrieve an entity using get-or-create semantics, i.e. it returns a matching entity if one exists, otherwise it creates one. Again, this mechanism is thread-safe, so it doesn’t matter how many threads call
getOrCreatesimultaneously, only one entity will be created for each key-value pair. This functionality is also exposed through the REST API, via a
|Alistair Jones and Julian Simpson|
Array properties have been supported in Neo4j for a long time, but until now it wasn’t possible to query on them. This milestone makes it possible to filter on array properties in Cypher. We have also improved aggregation performance.
Neo4j uses Apache Lucene for its indexing features – this allows you to find “entry points” into the graph before starting graph-based queries. Lucene is an actively developed project in its own right, and is constantly being enhanced and improved. In this Neo4j release, we’re taking the opportunity to upgrade to a newer stable release of Apache Lucene, so that all users get the benefits of recent enhancements in Lucene. We’ve moved to Lucene 3.5; for details on all the changes, have a look at their changelog.
This milestone includes a number of bug fixes. For more information please have a look at the “CHANGES.txt” files in each of our release packages.
Go for it
It’s available on as a hosted cloud service on Heroku right now, or download the packages from our website. If you’d like to stay up to date with new features in the pipeline, and share your experience with other users, we would love for you to join our community mailing list.
Rickard Öberg, Alistair Jones and Julian Simpson
Developers @ Neo Technology
Want to learn more about graph databases? Click below to get your free copy of O’Reilly’s Graph Databases ebook and discover how to use graph technologies for your application today. Download My Ebook
Share your Graph Story?
Email us: firstname.lastname@example.org
Have a Graph Question?
Reach out and connect with the Neo4j staff.Stackoverflow
Popular Graph Topics
- cypher (166)
- graph database (152)
- graphconnect (121)
- nosql (115)
- emil eifrem (76)
- graph visualization (60)
- relational database (52)
- Graph Databases (50)
- Graph Databases (50)
- community (46)