Release: 3 Essentials of Neo4j 3.0, from Scale to Productivity & Deployment
Official Release: 3 Essentials of Neo4j 3.0, from Scale to Productivity & Deployment
As the first release in the 3.x series, Neo4j 3.0 is based on a completely redesigned architecture and a commitment to offer the world’s most scalable graph database, greater developer productivity and a wide range of deployment choices.
What are the top three things to look for in Neo4j 3.0?
- Completely redesigned internals that remove all previous limits on the number of nodes, relationships and properties that can be stored and indexed
- Officially supported language drivers backed by the new Bolt binary protocol with new support for Java Stored Procedures, together enabling full-stack developers to build powerful applications
- A streamlined configuration and deployment structure to deploy Neo4j on premise or in the cloud
Let’s take a closer look at what’s new in Neo4j 3.0:
1. Massive Scale and Performance
Neo4j 3.0 for Giant Graphs
The centerpiece of Neo4j’s architecture overhaul is a redesigned data store.
Dynamic pointer compression expands Neo4j’s available address space as needed, making it possible to store graphs of any size. That’s right: no more 34 billion node limits!
Performance and scale are often at odds, and scaling without performance isn’t very useful. The approach we’ve invented maintains index-free adjacency, allowing each node to locate adjacent nodes and relationships via a pointer hop, and preserving the ultra-fast performance that Neo4j is known for. This feature is available in Neo4j Enterprise Edition, nicely complementing its scale-out clustering capabilities.
Improved Cost-based Optimizer
The cost-based query optimizer for read-only queries introduced from Neo4j 2.2. onwards has evolved in Neo4j 3.0. In 3.0, the cost-based optimizer has been improved with added support for write queries (in addition to reads). The new parallel indexes capability in the optimizer also enables faster population of indexes.
In the same realm, here are a few other Cypher improvements in Neo4j 3.0:
- The keywords
ENDS WITH
andCONTAINS
are now index-backed - Global aggregation improvements for activities like counting nodes by label
- Value joins speed queries where no relationship link exists
2. Developer Productivity Brought to New Heights
Official Language Drivers & Bolt: Neo4j’s New Binary Protocol
One of the things we’re excited to deliver as part of Neo4j 3.0 is official drivers for the most popular programming languages. These will make development easier and more productive, and enable an entirely new range of language-specific learning resources. (More below.)
In order to bring you the best and most usable drivers, we carefully examined the way that applications connect to Neo4j. The result is not just drivers, but an end-to-end infrastructure stack that starts with new drivers, a new binary protocol (which under the hood includes a new multi-versioned client API and new serialization format) and a uniform type system.
Let’s start with Bolt: a new connection-oriented protocol for accessing the graph.
Bolt uses a compact binary encoding over TCP or web sockets for higher throughput and lower latency. Lightweight and efficient, Bolt uses a new serialization format called PackStream and also introduces a new uniform graph type system that bridges storage, transport, Cypher, drivers and apps. Bolt has TLS security built in and enabled by default, as we care about ensuring that your data is protected.
For everyone building Neo4j applications, Bolt will improve both the performance of the graph database as well as the developer experience.
To complement Bolt, we’re releasing official language drivers which encapsulate the protocol, freeing contributors to focus on unique language and framework integration. The new official language drivers include:
- JavaScript
- Python
- Java
- .NET
The new official language drivers are also pluggable into richer programming frameworks. For example, Spring Data Neo4j v4.1 uses the Bolt-based object-to-graph mapper.
Let’s look at some example code for each of the official language drivers using Bolt:
With JavaScript:
var driver = Graph.Database.driver("bolt://localhost"); var session = driver.session(); var result = session.run("MATCH (u:User) RETURN u.name");
With Python:
driver = Graph.Database.driver("bolt://localhost") session = driver.session() result = session.run("MATCH (u:User) RETURN u.name")
With Java:
Driver driver = GraphDatabase.driver( "bolt://localhost" ); try ( Session session = driver.session() ) { StatementResult result = session.run("MATCH (u:User) RETURN u.name"); }
With .NET:
using (var driver = GraphDatabase.Driver("bolt://localhost")) using (var session = driver.Session()) { var result = session.Run("MATCH (u:User) RETURN u.name"); }
For all the detail about coding with the official drivers, see the Neo4j Developer Manual.
Java Stored Procedures
Another powerful new facility of Neo4j 3.0 is Java Stored Procedures. These provide direct, low-level access to the graph, giving you a way to run imperative code when you want to do more complex work inside of the database.
Java Stored Procedures can be called independently, or they can also be parameterized, can return results, and can even be mixed with Cypher to blend the best of declarative and imperative coding.
You can create Java Stored Procedures that are:
- Written in any JVM language
- Stored in Neo4j
- Accessed by applications over Bolt
- Executed on the server
The possibilities are endless: loading data from external sources, running graph algorithms, reverse engineering the meta graph or even simply creating UUIDs.
Neo4j comes with a set of built-in procedures, and the community was quick to step up and provide a collection of useful procedures as part of the APOC project, where 99 procedures are available as of today’s launch.
Check out this example, which blends a Java Stored Procedure to load data using JDBC, then applies the rows of the result to a Cypher MERGE
clause to create data.
Neo4j Browser Sync
Neo4j Browser Sync (or just “Browser Sync” for short) is a companion cloud service for Neo4j Browser. Browser Sync allows you to synchronize saved scripts and graph style sheets as well as preserve client-side work across connections. This means that your scripts and settings will be available to you as you move from database to database, machine to machine and web browser to web browser.
Browser Sync gives you quick and easy access to your favorite and most commonly used Cypher queries. In fact, you can store an unlimited number of queries with Browser Sync.
Currently registered users can opt-in to Neo4j Browser Sync and new users can connect with existing online credentials (e.g., GitHub, Google, or Twitter ID).
3. Deploy Neo4j 3.0 Applications Anywhere
Deployable in the Cloud, Containers and On Premise
We took advantage of a major release to make some changes in the way Neo4j is operated and configured, specifically in the areas of the Neo4j directory structure, configuration and logging. These changes incorporate lessons from years of operating Neo4j across many different operating environments, while also accounting for the new deployment infrastructures of today’s development world.
The new file
, config
and log
structures in Neo4j 3.0 are designed to streamline operations and to bring Neo4j better into line with operational IT expectations. One notable change is to move from multiple config
files to a single namespaced files. A config
migration utility has been supplied to make your transition as seamless as possible.
The result will allow you to more easily run Neo4j on premise and across a wide variety of modern deployment scenarios, allowing you to deploy Neo4j virtually anywhere. Major changes include:
Config
settings were cleaned-up and renamed to conform to a hierarchical and more consistent namespace structureLog
files are now aggregated into single location on disk (enabling to be mounted on separate write-optimized partition)- Added support to hold multiple databases in the
/database
folder and mount them by name
The improved database operations make it easier than ever to deploy Neo4j 3.0 on premise, in virtualized and containerized environments or in the cloud on the IaaS or PaaS of your choice. Look to the new Neo4j Operations Manual to learn all the details.
Conclusion
We’re happy to bring you Neo4j 3.0 today as the next major evolution in graph database technology. It’s a great beginning to a new 3.x series, which bears the hallmark of even more and better things to come.
As we get to work on Neo4j 3.1, we hope this landmark release will help you to push the boundaries of what you believed to be possible with graph databases.
Speaking for the entire Neo4j team, we hope you will enjoy this release, and wish you very happy graphing with the new Neo4j 3.0.
Click below to get started with Neo4j 3.0 and start building massive-scale graph applications with unmatched developer productivity.
About the Author
Philip Rathle, VP of Products
Philip Rathle has a passion for building great products that help users solve tomorrow’s challenges. He spent the first decade of his career building information solutions for some of the world’s largest companies: first with Accenture, then with Tanning Technology, one of the world’s top database consultancies of the time, as a solution architect focusing on data warehousing and BI strategy.
Sponsored by Neotechnology