SlideShare a Scribd company logo
1 of 68
Download to read offline
Webinar
June 25 2013
Walkthrough Neo4j 1.9.1 & 2.0
Michael Hunger, Neo Technology
@mesirii
Overview
Overview
• Neo4j 1.9.1
• High Availability & Operations
• Performance & Cypher
• Neo4j 2.0
• Extension Property Graph Model - Labels & Indexes
• Cypher
• Transactional Http Endpoint
Neo4j 1.9.1
High Availability & Operations
• new HA cluster management implementation (paxos) w/o ZK
• ZK compatibility layer for rolling upgrades from 1.8
• faster consistency check with new implementation
• new HA JMX information -> JConsole
• Arbiter instance for clusters < 3
• Slave only mode
• new endpoint for load balancers /db/manage/server/ha/{master,slave}
Hands-On High Availability
• Manual 1.8 vs. Manual 1.9
• Live
• 3 node cluster
• runs without zookeeper
• show that replication works
• show management endpoint and JMX
• show config
General
• Java 7 support
• Store-Locks to limit access of Readonly-Instances
• Online backup enabled by default, works with port-range
• Performance
• caching & property access improvements
• REST-Batch-Operations speedup
Server
• Traversal Javascript is sandboxed
• X-Forwarded-Host and X-Forwarded-Proto headers to support
running behind a proxy
• SSL certificate chain support
• REST-batch-operations performance improvements
• Gremlin plugin as separate project
• to allow different versions and decouple from neo4j release cycle
Cypher
• upgrade to scala 2.10
• concurrent parsing
• execution plan description
• fix non-lazyness
• faster pattern matcher (bi-directional traversal)
• top-n select for order by limit
Cypher
• predicates as expressions
• Functions: reduce, string functions
• order by, skip, limit with WITH
• automatic conversion
• SET can work with other nodes or maps
Hands-On Cypher
• profiling
• string functions, show reduce
• WITH with ORDER BY LIMIT
• SET with predicates, SET with other nodes
• FOREACH with CREATE UNIQUE
Why 2.0?
(0.x) --> (1.x) --> (2.x)
(0.x) --> (1.x) --> (2.x)
• 0.x was about embedded java
(0.x) --> (1.x) --> (2.x)
• 0.x was about embedded java
• 1.x introduced indexes, the server and REST
(0.x) --> (1.x) --> (2.x)
• 0.x was about embedded java
• 1.x introduced indexes, the server and REST
• 2.x ease of use, big data, cloud
(0.x) --> (1.x) --> (2.x)
• 0.x was about embedded java
• 1.x introduced indexes, the server and REST
• 2.x ease of use, big data, cloud
which means a focus on...
This guy
Focus on Cypher
Focus on Cypher
• Cypher, a carefully crafted language for working with graphs
Focus on Cypher
• Cypher, a carefully crafted language for working with graphs
• Declarative, friendly, easy to read and write
Focus on Cypher
• Cypher, a carefully crafted language for working with graphs
• Declarative, friendly, easy to read and write
• One language, used everywhere
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 extensions,
What is new in 2.0?
There will be
some sad Danes
"Once you label me,
you negate me.”
- Søren Kierkegaard
Introducing Node Labels
name: 'Soren'
• Simply: a label identifies a set of nodes
Introducing Node Labels
name: 'Soren'
• Simply: a label identifies a set of nodes
Introducing Node Labels
name: 'Soren'
Dane
• Simply: a label identifies a set of nodes
• Nodes can have multiple labels
Introducing Node Labels
name: 'Soren'
Dane
• Simply: a label identifies a set of nodes
• Nodes can have multiple labels
Introducing Node Labels
name: 'Soren'
Negated Dane
• Simply: a label identifies a set of nodes
• Nodes can have multiple labels
Introducing Node Labels
name: 'Soren'
Negated
name: 'Soren'
img:
Dane
• Simply: a label identifies a set of nodes
• Nodes can have multiple labels
• Find nodes by label
Introducing Node Labels
name: 'Soren'
Negated
name: 'Soren'
img:
Dane
• Simply: a label identifies a set of nodes
• Nodes can have multiple labels
• Find nodes by label
• Constrain properties and values
(lightweight, optional schema)
Introducing Node Labels
name: 'Soren'
Negated
name: 'Soren'
img:
Dane
• Simply: a label identifies a set of nodes
• Nodes can have multiple labels
• Find nodes by label
• Constrain properties and values
(lightweight, optional schema)
• A simple idea, with powerful applications
Introducing Node Labels
name: 'Soren'
Negated
name: 'Soren'
img:
Dane
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;
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)
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 })
ON CREATE charlie SET charlie.created = timestamp()
RETURN charlie
Transactional Cypher
• begin, commit, or rollback a transaction
Transactional Cypher
• begin, commit, or rollback a transaction
• transaction as RESTful resource
Transactional Cypher
• begin, commit, or rollback a transaction
• transaction as RESTful resource
• issue multiple statements per request
Transactional Cypher
• begin, commit, or rollback a transaction
• transaction as RESTful resource
• issue multiple statements per request
• multiple requests per transaction
Transactional Cypher
• begin, commit, or rollback a transaction
• transaction as RESTful resource
• issue multiple statements per request
• multiple requests per transaction
• compact response format
Transactional Cypher
• begin, commit, or rollback a transaction
• transaction as RESTful resource
• issue multiple statements per request
• multiple requests per transaction
• compact response format
Transactional Cypher
Anything else?
Anything else?
• Performance improvements
Anything else?
• Performance improvements
• Breaking changes to some APIs (read CHANGES.txt)
Anything else?
• Performance improvements
• Breaking changes to some APIs (read CHANGES.txt)
• Migration of "legacy" indexes (stop STARTing)
Anything else?
• Performance improvements
• Breaking changes to some APIs (read CHANGES.txt)
• Migration of "legacy" indexes (stop STARTing)
• Mandatory transactions for all DB interactions
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)
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"
How to use labels?
Label - special nodes
• replace built-in reference node,
with domain specific reference nodes
42
Label - special nodes
• replace built-in reference node,
with domain specific reference nodes
42
Answer
Labels - rules of thumb
Labels - rules of thumb
• Use a label to make queries easier to read & write
Labels - rules of thumb
• Use a label to make queries easier to read & write
• And to improve performance through indexing
Labels - rules of thumb
• Use a label to make queries easier to read & write
• And to improve performance through indexing
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
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
Hands-On Cypher
• Migrate Cineasts dataset to use Labels
• Show MATCH on Labels and Properties (+ profile)
• Add an Index on :Person(name) :Movie(title)
• Show MATCH on Labels and Properties (+ profile)
• Show MERGE
Hands-On 2.0
• Show Transactional HTTP-Endpoint
• POST initial statements, look at result, check currently running tx in
server-info
• POST another create statement to the tx
• POST a new read statement to a new tx that shows isolation
• DELETE second transaction
• POST to COMMIT resource
Is that it for 2.0?
Well, there is this...
Googlehttp://localhost:7474/
Neo4j
LoadTransactions
Neo4j
2.0.0
Active Queries 12Master
/var/neo4j/webui.graphdb Active Queries 12
MATCH (n)-[:FRIEND]->(friends) WHERE n.name = 'Andreas'Create a blank node
CREATE (n);
Clear all
MATCH (n)-[r?]->(m)
DELETE n,r,m;
ad-hoc query
Relate People
MATCH (from),(to) WHERE
n.name = {from}
AND to.name = {to}
CREATE (from)-[:FRIEND]-
>(to);
Delia
Andreas
m
People
CREATE (n);
Andreas
Name
Metaphysical
Mood
Delia Excited
Friends by name
CREATE (n);
Andreas
From
Delia
To
Delia Tiberius
Mood survey
CREATE (n);
Andreas
Name
Metaphysical
Mood
Delia Excited
MATCH (n) RETURN n
People Books ClassicsAuthors
CREATE (me:People {name:'Andreas'})
What is new in 2.0?
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
Thanks :)
MATCH (you)-[:HAVE]->(question)
RETURN question.text
@neo4j or @mesirii to keep in touch

More Related Content

What's hot

What's hot (20)

Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...
 
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariStreamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache Ambari
 
SolrCloud on Hadoop
SolrCloud on HadoopSolrCloud on Hadoop
SolrCloud on Hadoop
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
Supercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSupercharging Content Delivery with Varnish
Supercharging Content Delivery with Varnish
 
Spark zeppelin-cassandra at synchrotron
Spark zeppelin-cassandra at synchrotronSpark zeppelin-cassandra at synchrotron
Spark zeppelin-cassandra at synchrotron
 
Scaling Through Partitioning and Shard Splitting in Solr 4
Scaling Through Partitioning and Shard Splitting in Solr 4Scaling Through Partitioning and Shard Splitting in Solr 4
Scaling Through Partitioning and Shard Splitting in Solr 4
 
Scaling search with SolrCloud
Scaling search with SolrCloudScaling search with SolrCloud
Scaling search with SolrCloud
 
Simplified Cluster Operation & Troubleshooting
Simplified Cluster Operation & TroubleshootingSimplified Cluster Operation & Troubleshooting
Simplified Cluster Operation & Troubleshooting
 
Johnny Miller – Cassandra + Spark = Awesome- NoSQL matters Barcelona 2014
Johnny Miller – Cassandra + Spark = Awesome- NoSQL matters Barcelona 2014Johnny Miller – Cassandra + Spark = Awesome- NoSQL matters Barcelona 2014
Johnny Miller – Cassandra + Spark = Awesome- NoSQL matters Barcelona 2014
 
Python and Oracle : allies for best of data management
Python and Oracle : allies for best of data managementPython and Oracle : allies for best of data management
Python and Oracle : allies for best of data management
 
Cross Datacenter Replication in Apache Solr 6
Cross Datacenter Replication in Apache Solr 6Cross Datacenter Replication in Apache Solr 6
Cross Datacenter Replication in Apache Solr 6
 
Hadoop Security Now and Future
Hadoop Security Now and FutureHadoop Security Now and Future
Hadoop Security Now and Future
 
Introduction to Apache Solr
Introduction to Apache SolrIntroduction to Apache Solr
Introduction to Apache Solr
 
ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)ELK Ruminating on Logs (Zendcon 2016)
ELK Ruminating on Logs (Zendcon 2016)
 
Solr Exchange: Introduction to SolrCloud
Solr Exchange: Introduction to SolrCloudSolr Exchange: Introduction to SolrCloud
Solr Exchange: Introduction to SolrCloud
 
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
TXLF: Chef- Software Defined Infrastructure Today & TomorrowTXLF: Chef- Software Defined Infrastructure Today & Tomorrow
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
 
Habits of Effective Sqoop Users
Habits of Effective Sqoop UsersHabits of Effective Sqoop Users
Habits of Effective Sqoop Users
 
Introduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf TrainingIntroduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf Training
 
Embrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleEmbrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with Ripple
 

Similar to Walkthrough Neo4j 1.9 & 2.0

Webinar: What's new in Neo4j 2.0
Webinar: What's new in Neo4j 2.0 Webinar: What's new in Neo4j 2.0
Webinar: What's new in Neo4j 2.0
Neo4j
 
Seedhack MongoDB 2011
Seedhack MongoDB 2011Seedhack MongoDB 2011
Seedhack MongoDB 2011
Rainforest QA
 
What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013
What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013
What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013
Neo4j
 
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
OpenBlend society
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
_zaMmer_
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
_zaMmer_
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
Avi Kedar
 

Similar to Walkthrough Neo4j 1.9 & 2.0 (20)

Webinar: What's new in Neo4j 2.0
Webinar: What's new in Neo4j 2.0 Webinar: What's new in Neo4j 2.0
Webinar: What's new in Neo4j 2.0
 
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQLNoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
 
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swagger
 
The Return of the Living Datalog
The Return of the Living DatalogThe Return of the Living Datalog
The Return of the Living Datalog
 
Seedhack MongoDB 2011
Seedhack MongoDB 2011Seedhack MongoDB 2011
Seedhack MongoDB 2011
 
Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)
 
Introduction to Laravel
Introduction to LaravelIntroduction to Laravel
Introduction to Laravel
 
Introduction to Neo4j and .Net
Introduction to Neo4j and .NetIntroduction to Neo4j and .Net
Introduction to Neo4j and .Net
 
What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013
What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013
What's New in Neo4j 2.0 - Andreas Kollegger @ GraphConnect Boston + Chicago 2013
 
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
 
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Exploiting NoSQL Like Never Before
Exploiting NoSQL Like Never BeforeExploiting NoSQL Like Never Before
Exploiting NoSQL Like Never Before
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
 
Inside Wordnik's Architecture
Inside Wordnik's ArchitectureInside Wordnik's Architecture
Inside Wordnik's Architecture
 
Power of Azure Devops
Power of Azure DevopsPower of Azure Devops
Power of Azure Devops
 
Clustrix Database Percona Ruby on Rails benchmark
Clustrix Database Percona Ruby on Rails benchmarkClustrix Database Percona Ruby on Rails benchmark
Clustrix Database Percona Ruby on Rails benchmark
 
05 integrate redis
05 integrate redis05 integrate redis
05 integrate redis
 

More from Neo4j

More from Neo4j (20)

From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxFrom Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMs
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansQIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...
ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...
ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...
 
BBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafos
BBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafosBBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafos
BBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafos
 
Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...
Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...
Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdfNeo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
 
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdfRabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
 
Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
Neo4j: Data Engineering for RAG (retrieval augmented generation)
Neo4j: Data Engineering for RAG (retrieval augmented generation)Neo4j: Data Engineering for RAG (retrieval augmented generation)
Neo4j: Data Engineering for RAG (retrieval augmented generation)
 
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdfNeo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
 
Enabling GenAI Breakthroughs with Knowledge Graphs
Enabling GenAI Breakthroughs with Knowledge GraphsEnabling GenAI Breakthroughs with Knowledge Graphs
Enabling GenAI Breakthroughs with Knowledge Graphs
 

Recently uploaded

Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in PakistanChallenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
vineshkumarsajnani12
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
Nauman Safdar
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
daisycvs
 

Recently uploaded (20)

How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024
 
Arti Languages Pre Seed Teaser Deck 2024.pdf
Arti Languages Pre Seed Teaser Deck 2024.pdfArti Languages Pre Seed Teaser Deck 2024.pdf
Arti Languages Pre Seed Teaser Deck 2024.pdf
 
Kalyan Call Girl 98350*37198 Call Girls in Escort service book now
Kalyan Call Girl 98350*37198 Call Girls in Escort service book nowKalyan Call Girl 98350*37198 Call Girls in Escort service book now
Kalyan Call Girl 98350*37198 Call Girls in Escort service book now
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business Growth
 
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
 
joint cost.pptx COST ACCOUNTING Sixteenth Edition ...
joint cost.pptx  COST ACCOUNTING  Sixteenth Edition                          ...joint cost.pptx  COST ACCOUNTING  Sixteenth Edition                          ...
joint cost.pptx COST ACCOUNTING Sixteenth Edition ...
 
WheelTug Short Pitch Deck 2024 | Byond Insights
WheelTug Short Pitch Deck 2024 | Byond InsightsWheelTug Short Pitch Deck 2024 | Byond Insights
WheelTug Short Pitch Deck 2024 | Byond Insights
 
Uneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration PresentationUneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration Presentation
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptx
 
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
 
Buy gmail accounts.pdf buy Old Gmail Accounts
Buy gmail accounts.pdf buy Old Gmail AccountsBuy gmail accounts.pdf buy Old Gmail Accounts
Buy gmail accounts.pdf buy Old Gmail Accounts
 
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGBerhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
 
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in PakistanChallenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
 
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGBerhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
 
Nashik Call Girl Just Call 7091819311 Top Class Call Girl Service Available
Nashik Call Girl Just Call 7091819311 Top Class Call Girl Service AvailableNashik Call Girl Just Call 7091819311 Top Class Call Girl Service Available
Nashik Call Girl Just Call 7091819311 Top Class Call Girl Service Available
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
 
CROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NSCROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NS
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
 
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
 

Walkthrough Neo4j 1.9 & 2.0

  • 1. Webinar June 25 2013 Walkthrough Neo4j 1.9.1 & 2.0 Michael Hunger, Neo Technology @mesirii
  • 3. Overview • Neo4j 1.9.1 • High Availability & Operations • Performance & Cypher • Neo4j 2.0 • Extension Property Graph Model - Labels & Indexes • Cypher • Transactional Http Endpoint
  • 5. High Availability & Operations • new HA cluster management implementation (paxos) w/o ZK • ZK compatibility layer for rolling upgrades from 1.8 • faster consistency check with new implementation • new HA JMX information -> JConsole • Arbiter instance for clusters < 3 • Slave only mode • new endpoint for load balancers /db/manage/server/ha/{master,slave}
  • 6. Hands-On High Availability • Manual 1.8 vs. Manual 1.9 • Live • 3 node cluster • runs without zookeeper • show that replication works • show management endpoint and JMX • show config
  • 7. General • Java 7 support • Store-Locks to limit access of Readonly-Instances • Online backup enabled by default, works with port-range • Performance • caching & property access improvements • REST-Batch-Operations speedup
  • 8. Server • Traversal Javascript is sandboxed • X-Forwarded-Host and X-Forwarded-Proto headers to support running behind a proxy • SSL certificate chain support • REST-batch-operations performance improvements • Gremlin plugin as separate project • to allow different versions and decouple from neo4j release cycle
  • 9. Cypher • upgrade to scala 2.10 • concurrent parsing • execution plan description • fix non-lazyness • faster pattern matcher (bi-directional traversal) • top-n select for order by limit
  • 10. Cypher • predicates as expressions • Functions: reduce, string functions • order by, skip, limit with WITH • automatic conversion • SET can work with other nodes or maps
  • 11. Hands-On Cypher • profiling • string functions, show reduce • WITH with ORDER BY LIMIT • SET with predicates, SET with other nodes • FOREACH with CREATE UNIQUE
  • 13. (0.x) --> (1.x) --> (2.x)
  • 14. (0.x) --> (1.x) --> (2.x) • 0.x was about embedded java
  • 15. (0.x) --> (1.x) --> (2.x) • 0.x was about embedded java • 1.x introduced indexes, the server and REST
  • 16. (0.x) --> (1.x) --> (2.x) • 0.x was about embedded java • 1.x introduced indexes, the server and REST • 2.x ease of use, big data, cloud
  • 17. (0.x) --> (1.x) --> (2.x) • 0.x was about embedded java • 1.x introduced indexes, the server and REST • 2.x ease of use, big data, cloud which means a focus on...
  • 20. Focus on Cypher • Cypher, a carefully crafted language for working with graphs
  • 21. Focus on Cypher • Cypher, a carefully crafted language for working with graphs • Declarative, friendly, easy to read and write
  • 22. Focus on Cypher • Cypher, a carefully crafted language for working with graphs • Declarative, friendly, easy to read and write • One language, used everywhere
  • 23. 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 extensions,
  • 24. What is new in 2.0?
  • 25. There will be some sad Danes "Once you label me, you negate me.” - Søren Kierkegaard
  • 27. • Simply: a label identifies a set of nodes Introducing Node Labels name: 'Soren'
  • 28. • Simply: a label identifies a set of nodes Introducing Node Labels name: 'Soren' Dane
  • 29. • Simply: a label identifies a set of nodes • Nodes can have multiple labels Introducing Node Labels name: 'Soren' Dane
  • 30. • Simply: a label identifies a set of nodes • Nodes can have multiple labels Introducing Node Labels name: 'Soren' Negated Dane
  • 31. • Simply: a label identifies a set of nodes • Nodes can have multiple labels Introducing Node Labels name: 'Soren' Negated name: 'Soren' img: Dane
  • 32. • Simply: a label identifies a set of nodes • Nodes can have multiple labels • Find nodes by label Introducing Node Labels name: 'Soren' Negated name: 'Soren' img: Dane
  • 33. • Simply: a label identifies a set of nodes • Nodes can have multiple labels • Find nodes by label • Constrain properties and values (lightweight, optional schema) Introducing Node Labels name: 'Soren' Negated name: 'Soren' img: Dane
  • 34. • Simply: a label identifies a set of nodes • Nodes can have multiple labels • Find nodes by label • Constrain properties and values (lightweight, optional schema) • A simple idea, with powerful applications Introducing Node Labels name: 'Soren' Negated name: 'Soren' img: Dane
  • 35. 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;
  • 36. 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)
  • 37. 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 }) ON CREATE charlie SET charlie.created = timestamp() RETURN charlie
  • 39. • begin, commit, or rollback a transaction Transactional Cypher
  • 40. • begin, commit, or rollback a transaction • transaction as RESTful resource Transactional Cypher
  • 41. • begin, commit, or rollback a transaction • transaction as RESTful resource • issue multiple statements per request Transactional Cypher
  • 42. • begin, commit, or rollback a transaction • transaction as RESTful resource • issue multiple statements per request • multiple requests per transaction Transactional Cypher
  • 43. • begin, commit, or rollback a transaction • transaction as RESTful resource • issue multiple statements per request • multiple requests per transaction • compact response format Transactional Cypher
  • 44. • begin, commit, or rollback a transaction • transaction as RESTful resource • issue multiple statements per request • multiple requests per transaction • compact response format Transactional Cypher
  • 47. Anything else? • Performance improvements • Breaking changes to some APIs (read CHANGES.txt)
  • 48. Anything else? • Performance improvements • Breaking changes to some APIs (read CHANGES.txt) • Migration of "legacy" indexes (stop STARTing)
  • 49. Anything else? • Performance improvements • Breaking changes to some APIs (read CHANGES.txt) • Migration of "legacy" indexes (stop STARTing) • Mandatory transactions for all DB interactions
  • 50. 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)
  • 51. 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"
  • 52. How to use labels?
  • 53. Label - special nodes • replace built-in reference node, with domain specific reference nodes 42
  • 54. Label - special nodes • replace built-in reference node, with domain specific reference nodes 42 Answer
  • 55. Labels - rules of thumb
  • 56. Labels - rules of thumb • Use a label to make queries easier to read & write
  • 57. Labels - rules of thumb • Use a label to make queries easier to read & write • And to improve performance through indexing
  • 58. Labels - rules of thumb • Use a label to make queries easier to read & write • And to improve performance through indexing
  • 59. 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
  • 60. 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
  • 61. Hands-On Cypher • Migrate Cineasts dataset to use Labels • Show MATCH on Labels and Properties (+ profile) • Add an Index on :Person(name) :Movie(title) • Show MATCH on Labels and Properties (+ profile) • Show MERGE
  • 62. Hands-On 2.0 • Show Transactional HTTP-Endpoint • POST initial statements, look at result, check currently running tx in server-info • POST another create statement to the tx • POST a new read statement to a new tx that shows isolation • DELETE second transaction • POST to COMMIT resource
  • 63. Is that it for 2.0?
  • 64. Well, there is this...
  • 65. Googlehttp://localhost:7474/ Neo4j LoadTransactions Neo4j 2.0.0 Active Queries 12Master /var/neo4j/webui.graphdb Active Queries 12 MATCH (n)-[:FRIEND]->(friends) WHERE n.name = 'Andreas'Create a blank node CREATE (n); Clear all MATCH (n)-[r?]->(m) DELETE n,r,m; ad-hoc query Relate People MATCH (from),(to) WHERE n.name = {from} AND to.name = {to} CREATE (from)-[:FRIEND]- >(to); Delia Andreas m People CREATE (n); Andreas Name Metaphysical Mood Delia Excited Friends by name CREATE (n); Andreas From Delia To Delia Tiberius Mood survey CREATE (n); Andreas Name Metaphysical Mood Delia Excited MATCH (n) RETURN n People Books ClassicsAuthors CREATE (me:People {name:'Andreas'})
  • 66. What is new in 2.0?
  • 67. 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
  • 68. Thanks :) MATCH (you)-[:HAVE]->(question) RETURN question.text @neo4j or @mesirii to keep in touch