what's new in neo4j 2.0 - andreas kollegger @ graphconnect boston + chicago 2013
TRANSCRIPT
![Page 1: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/1.jpg)
Innovate. Share. Connect.Boston June 10-11
What's new in Neo4j 2.0What's new in Neo4j 2.0Andreas Kollegger, Neo TechnologyAndreas Kollegger, Neo Technology
@akollegger@akollegger
![Page 2: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/2.jpg)
Neo4j 2.0
★ 3 questions: Why? What? How?
★ with just One answer
![Page 3: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/3.jpg)
Why 2.0?
![Page 4: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/4.jpg)
Why 2.0?
• Neo4j 1.10 could be an AM radio station
• Wanted to seem web-savvy before it goes to 3.0
• We were in the mood to break some things
• Really, it's because of a shift in focus
![Page 5: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/5.jpg)
(0.x) --> (1.x) --> (2.x)
• 0.x was about embedded java
• 1.x introduced the server and REST
• 2.x ease of use, big data, cloud
which means a focus on...
![Page 6: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/6.jpg)
This guy
![Page 7: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/7.jpg)
Focus on Cypher
• Cypher, a carefully crafted language for working with graphs
• Declarative, friendly, easy to read and write
• One language, used everywhere
• REST for management, Java for plugins,
![Page 8: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/8.jpg)
What is new in 2.0?
![Page 9: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/9.jpg)
There will be some sad Danes
"Once you label me,you negate me.”
- Søren Kierkegaard
![Page 10: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/10.jpg)
• Simply: a label identifies a set of nodes
• Nodes can have multiple labels
• Find nodes by label
• Constrain properties and values
• (lightweight schema)
• A simple idea, with powerful applications
Introducing Node Labels
![Page 11: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/11.jpg)
Find friends who like cheese
MATCH (max:People)-[:FRIENDS]->(cheesy: People), (cheesy)-[:LIKE]->(cheese:Things)
WHERE max.name = "Max De Marzi"
AND cheese.name = "Cheese"
RETURN cheesy;
![Page 12: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/12.jpg)
Schema Indexing
• Indexes for labels, based on a property
• Simple lookups for now
• Unique indexing coming soon
• Full-text, other special indexes in planning
CREATE INDEX ON :People(name)
![Page 13: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/13.jpg)
MERGE operation• a combination of MATCH + CREATE
• replaces CREATE UNIQUE
• attempts to MATCH, with specified properties and labels
• if match fails, new graph data is created
• optional sub-clauses for handling ON CREATE, and ON MATCH
MERGE (charlie { name:'Charlie Sheen', age:10 })RETURN charlie
![Page 14: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/14.jpg)
• begin, commit, or rollback a transaction
• transaction as RESTful resource
• issue multiple statements per request
• multiple requests per transaction
• compact response format
Transactional Cypher
![Page 15: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/15.jpg)
Anything else?
• Performance improvements
• Breaking changes to some APIs (read CHANGES.txt)
• Migration of "legacy" indexes (stop STARTing)
• Mandatory transactions for all DB interactions
• Improving installers (in progress)
• Changing everything to be "all Cypher, all the time"
![Page 16: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/16.jpg)
How to use labels?
![Page 17: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/17.jpg)
Label - to identify
name: Ford PrefectNINO: 122-762-9255HIKE: 415-484-6364
UKUKH2G2H2G2
![Page 18: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/18.jpg)
Label - to identify
UKUKH2G2H2G2
MATCH (ford:H2G2) WHERE ford.HIKE = '415-484-6364' RETURN ford
![Page 19: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/19.jpg)
Label - to avoid confusion
name: Ford Prefect name: Ford Prefect
AlienAlien CarCar
MATCH (ford:Alien) WHERE ford.name = 'Ford Prefect' RETURN ford
![Page 20: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/20.jpg)
Label - special nodes
• replace built-in reference node, with domain specific reference nodes
4242AnswerAnswer
![Page 21: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/21.jpg)
Labels - rules of thumb• Use a label to make queries easier to read & write
• And to improve performance through indexing
• Start with anything you might've put in a legacy index
• Use lightly, as few labels as needed
![Page 22: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/22.jpg)
Is that it for 2.0?
![Page 23: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/23.jpg)
Well, there is this...
![Page 24: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/24.jpg)
![Page 25: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/25.jpg)
![Page 26: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/26.jpg)
![Page 27: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/27.jpg)
What is new in 2.0?
• It's all about Cypher, starting with
• Labels, the first significant change in over 12 years
• Mix in schema indexing
• Then transactional REST, new clauses, functions
• A fresh Web UI that is Cypher-focused
![Page 28: What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013](https://reader036.vdocuments.site/reader036/viewer/2022081519/555c2518d8b42a0b418b4c32/html5/thumbnails/28.jpg)
Thanks :)
Any questions?
@akollegger to keep in touch