SlideShare a Scribd company logo
1 of 34
Download to read offline
Redis Graph
A graph database built on top of redis
Open source in-memory database
Key => Data Structure server
Key features: Fast, Flexible, Simple
What’s Redis?
A Lego for your database
Key
"I'm a Plain Text String!"
{ A: “foo”, B: “bar”, C: “baz” }
Strings/Blobs/Bitmaps
Hash Tables (objects!)
Linked Lists
Sets
Sorted Sets
Geo Sets
HyperLogLog
{ A , B , C , D , E }
[ A → B → C → D → E ]
{ A: 0.1, B: 0.3, C: 100, D: 1337 }
{ A: (51.5, 0.12), B: (32.1, 34.7) }
00110101 11001110 10101010
Node
“Jerry Seinfeld”: {
First_Name: “Jerry”,
Age: 62
}
Jerry
Seinfeld
Relations
Jerry Berlin
Visit
SPO
SOP
OPS
OSP
PSO
POS
Hexastore
S
Subject
P
Predicate
O
Object
6
Hexastore
Triplets
SPO:Jerry:Visit:Berlin
SOP:Jerry:Berlin:Visit
OPS:Berlin:Visit:Jerry
OSP:Berlin:Jerry:Visit
PSO:Visit:Jerry:Berlin
POS:Visit:Berlin:Jerry
Jerry
S
Berlin
O
Visit
P
Places Jerry been to?
SPO:Jerry:Visit:*
Who visited Berlin?
OPS:Berlin:Visit:*
Who travels and to where?
PSO:Visit:*
Hexastore
Jerry
S
Berlin
O
Visit
P
Cypher*
MATCH (Jerry:’Jerry Seinfeld’)-[friend]->(F)-[visit]->(country)
WHERE (F.age >= Jerry.age AND country.continent = ‘Europe’)
RETURN F.name, count(country.name) AS countriesVisited
ORDER BY countriesVisited, F.age DESC
LIMIT 2
Query language
Tokenizer - Lex
Parser - Lemon, SQLite LALR(1) parser generator for C
opencypher
Query language
End to end
MATCH (Jerry:’Jerry Seinfeld’)-[friend]->(F)-[visit]->(Country)
WHERE F.age >= 50 AND Country.continent = “Europe”
RETURN F.name, F.age, Country.name
ORDER BY F.age DESC
LIMIT 5
End to end
LexerQuery Parser AST
End to end
AST
Root
Match Where Return Order
End to end
MATCH (Jerry:"Jerry Seinfeld")-[friend]->(F)-[visit]->(Country)
Alias:
Jerry
ID: Jerry
Seinfeld
Alias: F
ID: ?
Alias:
Country
ID: ?visitfriend
End to end
Alias:
Jerry
ID: Jerry
Seinfeld
Alias: F
ID: ?
Alias:
Country
ID: ?visitfriend
SPO:Jerry Seinfeld:friend:*
SPO:Jerry Seinfeld:friend:Cosmo Kramer
SPO:Jerry Seinfeld:friend:George Costanza
End to end
Alias:
Jerry
ID: Jerry
Seinfeld
Alias: F
ID:
Cosmo
Kramer
Alias:
Country
ID: ?visitfriend
End to end
WHERE F.age >= 50 AND Country.continent = “Europe”
AND
age >=
50
continent
=
“Europe”
Filter tree
End to end
AND
Kramer
.age >=
50
continent
=
“Europe”
Cosmo Kramer: {
Name: ‘Cosmo Kramer’,
Age: 48
}
End to end
AND
Kramer
.age >=
50
F
continent
=
“Europe”
Cosmo Kramer: {
Name: ‘Cosmo Kramer’,
Age: 48
}
End to end
AND
F
Kramer
.age >=
50
F
continent
=
“Europe”
Cosmo Kramer: {
Name: ‘Cosmo Kramer’,
Age: 48
}
End to end
Alias:
Jerry
ID: Jerry
Seinfeld
Alias: F
ID: ?
Alias:
Country
ID: ?visitfriend
SPO:Jerry Seinfeld:friend:*
SPO:Jerry Seinfeld:friend:Cosmo Kramer
SPO:Jerry Seinfeld:friend:George Costanza
End to end
Alias:
Jerry
ID: Jerry
Seinfeld
Alias: F
ID:
George
Costanza
Alias:
Country
ID: ?visitfriend
End to end
AND
George
.age >=
50
continent
=
“Europe”
George Costanza:{
Name: ‘George Costanza’,
Age: 52
}
End to end
AND
George
.age >=
50
T
continent
=
“Europe”
George Costanza:{
Name: ‘George Costanza’,
Age: 52
}
End to end
AND
T
George
.age >=
50
T
continent
=
“Europe”
T
George Costanza:{
Name: ‘George Costanza’,
Age: 52
}
End to end
Alias:
Jerry
ID: Jerry
Seinfeld
Alias: F
ID:
George
Costanza
Alias:
Country
ID: ?visitfriend
SPO:George Costanza:visit:*
SPO:George Costanza:visit:Italy
SPO:George Costanza:visit:Cuba
End to end
Alias:
Jerry
ID: Jerry
Seinfeld
Alias: F
ID:
George
Costanza
Alias:
Country
ID: Italyvisitfriend
End to end
AND
T
George
.age >=
50
T
Italy
.continent
=
“Europe”
T
George Costanza:{
Name: ‘George Costanza’,
Age: 52
}
Italy: {
Continent: ‘Europe’,
Population: 1000,
Name: ‘Italy’
}
End to end
TOP K heap
RETURN F.name, F.age,
Country.name
ORDER BY F.age DESC
LIMIT 5
[‘George Costanza’, 52,
Italy]
Features
Multi hop, multi entry point (A)-[R1]->(C)<-[R2]-(B)
(Nicolas:’Nicolas Cage’)-[act]->(Movie)<-[act]-(Actor)
Aggregations, Group bys RETURN F.gender, AVG(F.age) AS average_age
Order bys, Distinct
Benchmark
150K inserts per second
15K simple queries per second
There’s still work to be done
● Single node query: MATCH (A) RETURN A
● OPTIONAL MATCH
● WITH, SKIP, UNION
● Curly brackets filters (john {name: ‘John’})
● In place evaluations WHERE Me.age > F.age + X
● Shortest path between nodes (A)-[*]-(B)
● A number of aggregation functions: stdev, precentileCount
Roadmap
● Hexastore sorted-set -> Trie
● Indexed entities
● Single node query
● Python lib
Contribute/Contact
https://github.com/swilly22/redis-module-graph
@roilipman

More Related Content

More from openCypher

More from openCypher (20)

Graph abstraction
Graph abstractionGraph abstraction
Graph abstraction
 
From Cypher 9 to GQL: Conceptual overview of multiple named graphs and compos...
From Cypher 9 to GQL: Conceptual overview of multiple named graphs and compos...From Cypher 9 to GQL: Conceptual overview of multiple named graphs and compos...
From Cypher 9 to GQL: Conceptual overview of multiple named graphs and compos...
 
Cypher for Gremlin
Cypher for GremlinCypher for Gremlin
Cypher for Gremlin
 
Comparing PGQL, G-Core and Cypher
Comparing PGQL, G-Core and CypherComparing PGQL, G-Core and Cypher
Comparing PGQL, G-Core and Cypher
 
Multiple graphs in openCypher
Multiple graphs in openCypherMultiple graphs in openCypher
Multiple graphs in openCypher
 
Eighth openCypher Implementers Group Meeting: Status Update
Eighth openCypher Implementers Group Meeting: Status UpdateEighth openCypher Implementers Group Meeting: Status Update
Eighth openCypher Implementers Group Meeting: Status Update
 
Cypher for Gremlin
Cypher for GremlinCypher for Gremlin
Cypher for Gremlin
 
Supporting dates and times in Cypher
Supporting dates and times in CypherSupporting dates and times in Cypher
Supporting dates and times in Cypher
 
Seventh openCypher Implementers Group Meeting: Status Update
Seventh openCypher Implementers Group Meeting: Status UpdateSeventh openCypher Implementers Group Meeting: Status Update
Seventh openCypher Implementers Group Meeting: Status Update
 
Academic research on graph processing: connecting recent findings to industri...
Academic research on graph processing: connecting recent findings to industri...Academic research on graph processing: connecting recent findings to industri...
Academic research on graph processing: connecting recent findings to industri...
 
Property Graphs with Time
Property Graphs with TimeProperty Graphs with Time
Property Graphs with Time
 
Cypher.PL: Executable Specification of Cypher written in Prolog
Cypher.PL: Executable Specification of Cypher written in PrologCypher.PL: Executable Specification of Cypher written in Prolog
Cypher.PL: Executable Specification of Cypher written in Prolog
 
Use case: processing multiple graphs
Use case: processing multiple graphsUse case: processing multiple graphs
Use case: processing multiple graphs
 
openCypher Technology Compatibility Kit (TCK)
openCypher Technology Compatibility Kit (TCK)openCypher Technology Compatibility Kit (TCK)
openCypher Technology Compatibility Kit (TCK)
 
Cypher Editor in the Web
Cypher Editor in the WebCypher Editor in the Web
Cypher Editor in the Web
 
The inGraph project and incremental evaluation of Cypher queries
The inGraph project and incremental evaluation of Cypher queriesThe inGraph project and incremental evaluation of Cypher queries
The inGraph project and incremental evaluation of Cypher queries
 
Formal Specification of Cypher
Formal Specification of CypherFormal Specification of Cypher
Formal Specification of Cypher
 
Formal Semantics of SQL and Cypher
Formal Semantics of SQL and CypherFormal Semantics of SQL and Cypher
Formal Semantics of SQL and Cypher
 
Graph pattern matching semantics
Graph pattern matching semanticsGraph pattern matching semantics
Graph pattern matching semantics
 
Virtual Graphs & Graph Views in Cypher
Virtual Graphs & Graph Views in CypherVirtual Graphs & Graph Views in Cypher
Virtual Graphs & Graph Views in Cypher
 

Recently uploaded

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
Wonjun Hwang
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 

Recently uploaded (20)

Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 

Redis Graph