More Related Content

Similar to Introducing Neo4j 3.0(20)

Introducing Neo4j 3.0

  1. William Lyon @lyonwj
  2. William Lyon Developer Relations @neo4j will@neo4j.com @lyonwj lyonwj.com
  3. Neo4j 3.0: A New Foundation
  4. Neo4j 3.0: A New Foundation Develop Bigger and Faster Graph Applications Develop Applications Faster and Easier Deploy Neo4j Anywhere Easily
  5. Neo4j 3.0: A New Foundation Scale and performance Developer productivity Operability
  6. Scale and Performance
  7. Native Storage and Processing Index free-adjacency
  8. Scale https://tech.evojam.com/2016/04/20/tackling- a-1-billion-member-social-network-fast-search- on-a-large-graph/ http://kvangundy.com/wp/infographic-neo4j-high-availability/
  9. Up The Limits Graph size
  10. Giant Graphs with No Upper Bounds • Dynamic pointer compression allows graphs of unlimited size • Nodes, relationships, and properties • Unlimited index sizes • Smart algorithm 
 optimizes storage Define graphs of 
 any practical size NEO4J ENTERPRISE FEATURE
  11. Developer Productivity
  12. Neo4j Developer Surface • 2000-2010: 0.x - Embedded Java API • 2010-2014: 1.x - REST • 2014-2015: 2.x - Cypher
  13. Neo4j Developer Surface • 2000-2010: 0.x - Embedded Java API • 2010-2014: 1.x - REST • 2014-2015: 2.x - Cypher • 2016 - : 3.x - Bolt + Official Language Drivers Native LanguageDrivers BOLT
  14. Bolt
  15. Bolt + Official Language Drivers
  16. Official Language Drivers • Foundational drivers for popular programming languages • Bolt: streaming binary wire protocol • Authoritative mapping to native type system, uniform across drivers • Pluggable into richer frameworks Spring Data Neo4j v4.1 uses Bolt- based object-to-graph mapper JavaScript Java .NET Python Community Drivers Drivers Bolt
  17. Using Bolt: Official Language Drivers With JavaScript var driver = Graph.Database.driver("bolt://localhost");
 var session = driver.session();
 var result = session.run("MATCH (u:User) RETURN u.name");
  18. Using Bolt: Official Language Drivers With Python driver = Graph.Database.driver("bolt://localhost")
 session = driver.session()
 result = session.run("MATCH (u:User) RETURN u.name")
  19. Using Bolt: Official Language Drivers Driver driver = GraphDatabase.driver( "bolt://localhost" ); try ( Session session = driver.session() ) {
 StatementResult result = session.run("MATCH (u:User) RETURN u.name");
 } With Java
  20. Using Bolt: Official Language Drivers using (var driver = GraphDatabase.Driver("bolt://localhost")) using (var session = driver.Session()) {    var result = session.Run("MATCH (u:User) RETURN u.name"); } With .NET
  21. Java Stored Procedures Neo4j Execution Engine Java Stored Procedure Applications Bolt Java Stored Procedures let you write custom code that is: • Written in any JVM language • Stored on the server • Accessed by applications over Bolt • Executed on the server
  22. Neo4j Browser Sync Companion Cloud Service for Neo4j Browser • Synchronize scripts, settings, and graph-style sheets • Preserve client-side work 
 across connections • Personal cloud storage accessible from anywhere • Connect with existing online credentials • Opt-in for registered users
  23. Operability
  24. Operation in the Cloud, Containers and On Premises New file, config and log structure to support modern deployment scenarios 
 Improved database operations • On-premises • In virtualized and containerized environments • In the Cloud Neo4j Neo4j Application Neo4j
  25. Neo4j 3.0: A New Architecture Foundation Neo4j Neo4j Application Neo4j New language driversNew binary protocol New file, config and log structure 
 for tomorrow’s deployments Native LanguageDrivers BOLT New storage engine with no limits
 Enterprise Edition
  26. Deep Dive
  27. Release notes http://neo4j.com/release-notes/neo4j-3-0-0/ https://github.com/neo4j/neo4j/wiki/Neo4j-3.0-changelog
  28. Documentation http://neo4j.com/docs/
  29. Config and logs http://neo4j.com/docs/operations-manual/current/
  30. Java Stored Procedures User-defined procedures are written in Java, deployed into the database, and called from Cypher. http://neo4j.com/docs/developer-manual/current/#procedures
  31. Built-in Procedures
  32. Built-in Procedures
  33. User-defined Procedures https://github.com/neo4j-examples/neo4j-procedure-template
  34. Apoc Procedures https://github.com/neo4j-contrib/neo4j-apoc-procedures
  35. https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/master/readme.adoc
  36. Northwind
  37. Northwind
  38. Cypher • New cost-based optimizer for writes • Faster index population via parallel indexing • Always-on Bolt connection speeds high volumes of small queries Cypher Engine Parser Rule-based optimizer Cost-based optimizer Cypher Runtime Many other improvements including: • More index-based string queries: ENDS WITH and CONTAINS • Global aggregation improvements (e.g. counting nodes by label) • Value joins to speed queries where no relationship link exists
  39. Cypher – COST Planner for Writes cypher planner=rule MATCH (p:Product),(c:Category) WHERE p.category_id = c.id CREATE (c)-[:CONTAINS]->(p); Cypher version: CYPHER 3.0, planner: RULE. 3060001 total db hits in 7197 ms.
  40. Cypher – COST Planner for Writes cypher planner=cost MATCH (p:Product),(c:Category) WHERE p.category_id = c.id CREATE (c)-[:CONTAINS]->(p); Cypher version: CYPHER 3.0, planner: COST. 50003 total db hits in 3280 ms.
  41. Predicates for shortestPath MATCH (a:Loc {name:”Berlin"}), (b:Loc {name:"Dresden"}) 
 MATCH trip = shortestPath((a)-[roads:ROAD*]->(b)) 
 WHERE NONE(r in roads WHERE r.closed or r.speed < 30) 
 AND ( reduce(s=0, r in roads | s + r.distance) < 300 OR length(trip) < 50 ) RETURN trip;
  42. Spatial Functions LOAD CSV WITH HEADERS FROM {URL} AS row FIELDTERMINATOR "t" CREATE (:City {name:row.name, pop:toInt(row.einwohner), longitude:toFloat(row.lon), latitude:toFloat(row.lat)}); MATCH (a:City {name:"Berlin"}),(b:City {name:"Dresden"}) RETURN a.name, b.name, toInt(distance(point(a),point(b)) / 1000) as distance; +---------------------------------+ | a.name | b.name | distance | +---------------------------------+ | "Berlin" | "Dresden" | 165 | +---------------------------------+ http://gist.asciidoctor.org/?dropbox-14493611%2Fcypher_spatial.adoc
  43. Python Driver - demo https://github.com/johnymontana/neo4j-3.0-python-example/blob/master/conf-graph-ex.ipynb
  44. https://github.com/jexp/neo4j-spark-connector Neo4j Spark Connector Using Neo4j 3.0 Java Driver with Bolt
  45. https://github.com/johnymontana/neovis.js neovis.js Embeddable graph visualization powered by Neo4j 3.0 Bolt Javascript driver
  46. Upgrading
  47. Upgrading to 3.0 • Java 8 • Store format • Lucene upgrade - indexes rebuilt • Directory structure and config • Migration configuration tool neo4j.com/guides/upgrade/#neo4j-3-0
  48. How do I get it? http://neo4j.com/download/ http://neo4j.com/developer/docker/ http://debian.neo4j.org/
  49. Resources http://neo4j.com/developer/ Neo4j Developer Resources
  50. Questions? will@neo4j.com @lyonwj