SlideShare a Scribd company logo
Introduction to
Graph Databases
  Chicago Graph Database Meet-Up
          Max De Marzi
About Me
    Built the Neography Gem (Ruby
    Wrapper to the Neo4j REST API)
    Playing with Neo4j since 10/2009


•   My Blog: http://maxdemarzi.com
•   Find me on Twitter: @maxdemarzi
•   Email me: maxdemarzi@gmail.com
•   GitHub: http://github.com/maxdemarzi
Agenda
•   Trends in Data
•   NOSQL
•   What is a Graph?
•   What is a Graph Database?
•   What is Neo4j?
Trends in Data
Data is getting bigger:
“Every 2 days we
create as much
information as we did
up to 2003”

– Eric Schmidt, Google
Data is more connected:
•   Text (content)
•   HyperText (added pointers)
•   RSS (joined those pointers)
•   Blogs (added pingbacks)
•   Tagging (grouped related data)
•   RDF (described connected data)
•   GGG (content + pointers + relationships +
    descriptions)
Data is more Semi-Structured:
• If you tried to collect all the data of every
  movie ever made, how would you model it?
• Actors, Characters, Locations, Dates, Costs,
  Ratings, Showings, Ticket Sales, etc.
NOSQL
Not Only SQL
Less than 10% of the NOSQL Vendors
Key Value Stores
• Most Based on Dynamo: Amazon Highly
  Available Key-Value Store
• Data Model:
  – Global key-value mapping
  – Big scalable HashMap
  – Highly fault tolerant (typically)
• Examples:
  – Redis, Riak, Voldemort
Key Value Stores: Pros and Cons
• Pros:
  – Simple data model
  – Scalable
• Cons
  – Create your own “foreign keys”
  – Poor for complex data
Column Family
• Most Based on BigTable: Google’s Distributed
  Storage System for Structured Data
• Data Model:
  – A big table, with column families
  – Map Reduce for querying/processing
• Examples:
  – HBase, HyperTable, Cassandra
Column Family: Pros and Cons
• Pros:
  – Supports Simi-Structured Data
  – Naturally Indexed (columns)
  – Scalable
• Cons
  – Poor for interconnected data
Document Databases
• Data Model:
  – A collection of documents
  – A document is a key value collection
  – Index-centric, lots of map-reduce
• Examples:
  – CouchDB, MongoDB
Document Databases: Pros and Cons
• Pros:
  – Simple, powerful data model
  – Scalable
• Cons
  – Poor for interconnected data
  – Query model limited to keys and indexes
  – Map reduce for larger queries
Graph Databases
• Data Model:
  – Nodes and Relationships
• Examples:
  – Neo4j, OrientDB, InfiniteGraph, AllegroGraph
Graph Databases: Pros and Cons
• Pros:
  – Powerful data model, as general as RDBMS
  – Connected data locally indexed
  – Easy to query
• Cons
  – Sharding ( lots of people working on this)
     • Scales UP reasonably well
  – Requires rewiring your brain
Living in a NOSQL World
                                  RDBMS
                                Graph
                               Databases
Complexity




                                           Document
                                           Databases




                                                       BigTable
                                                        Clones

                                                                  Key-Value
             Relational                                             Store
             Databases




                           90% of
                          Use Cases
                                           Size
What is a Graph?
What is a Graph?
• An abstract representation of a set of objects
  where some pairs are connected by links.

             Object (Vertex, Node)

             Link (Edge, Arc, Relationship)
Different Kinds of Graphs
• Undirected Graph
• Directed Graph

• Pseudo Graph
• Multi Graph

• Hyper Graph
More Kinds of Graphs
• Weighted Graph

• Labeled Graph

• Property Graph
What is a Graph Database?
• A database with an explicit graph structure
• Each node knows its adjacent nodes
• As the number of nodes increases, the cost of
  a local step (or hop) remains the same
• Plus an Index for lookups
Compared to Relational Databases
 Optimized for aggregation   Optimized for connections
Compared to Key Value Stores
Optimized for simple look-ups   Optimized for traversing connected data
Compared to Key Value Stores
Optimized for “trees” of data   Optimized for seeing the forest and the
                                trees, and the branches, and the trunks
What is Neo4j?
What is Neo4j?
• A Graph Database + Lucene Index
• Property Graph
• Full ACID
  (atomicity, consistency, isolation, durability)
• High Availability (with Enterprise Edition)
• 32 Billion Nodes, 32 Billion Relationships,
  64 Billion Properties
• Embedded Server
• REST API
Good For
• Highly connected data (social networks)
• Recommendations (e-commerce)
• Path Finding (how do I know you?)

• A* (Least Cost path)
• Data First Schema (bottom-up, but you still
  need to design)
Property Graph
// then traverse to find results
    start n=(people-index, name, “Andreas”)
    match (n)--()--(foaf) return foaf




n
Cypher
Pattern Matching Query Language (like SQL for graphs)
 // get node 0

 start a=(0) return a

 // traverse from node 1

 start a=(1) match (a)-->(b) return b

 // return friends of friends

 start a=(1) match (a)--()--(c) return c
Gremlin
A Graph Scripting DSL (groovy-based)
 // get node 0

 g.v(0)

 // nodes with incoming relationship

 g.v(0).in

 // outgoing “KNOWS” relationship

 g.v(0).out(“KNOWS”)
If you’ve ever
•   Joined more than 7 tables together
•   Modeled a graph in a table
•   Written a recursive CTE
•   Tried to write some crazy stored procedure
    with multiple recursive self and inner joins

    You should use Neo4j
Language    LanguageCountry          Country

language_code     language_code      country_code
language_name     country_code       country_name
word_count        primary            flag_uri




       Language                             Country

name                                 name
                    IS_SPOKEN_IN
code                                 code
word_count           as_primary      flag_uri
name: “Canada”
                 languages_spoken: “[ „English‟, „French‟ ]”




                           language:“English”     spoken_in
                                                               name: “USA”




name: “Canada”




                 language:“French”    spoken_in
                                                     name: “France”
Country

                 name
                 flag_uri
                 language_name
                 number_of_words
                 yes_in_langauge
                 no_in_language
                 currency_code
                 currency_name

       Country
                                          Language
name                               name
flag_uri                SPEAKS
                                   number_of_words
                                   yes
                                   no
                        Currency
                   code
                   name
Neo4j Data Browser
Neo4j Console
console.neo4j.org
Try it right now:
start n=node(*) match n-[r:LOVES]->m return n, type(r), m
Notice the two nodes in red, they are your result set.
What does a Graph look like?
Questions?




  ?
Thank you!
 http://maxdemarzi.com

More Related Content

What's hot (20)

Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph Databases
DataStax
 
Intro to Neo4j and Graph Databases
Intro to Neo4j and Graph DatabasesIntro to Neo4j and Graph Databases
Intro to Neo4j and Graph Databases
Neo4j
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
PolarSeven Pty Ltd
 
Graph database Use Cases
Graph database Use CasesGraph database Use Cases
Graph database Use Cases
Max De Marzi
 
Neo4j Presentation
Neo4j PresentationNeo4j Presentation
Neo4j Presentation
Max De Marzi
 
Data Modeling with Neo4j
Data Modeling with Neo4jData Modeling with Neo4j
Data Modeling with Neo4j
Neo4j
 
Graph databases
Graph databasesGraph databases
Graph databases
Karol Grzegorczyk
 
Mining Data Streams
Mining Data StreamsMining Data Streams
Mining Data Streams
SujaAldrin
 
Introduction of Knowledge Graphs
Introduction of Knowledge GraphsIntroduction of Knowledge Graphs
Introduction of Knowledge Graphs
Jeff Z. Pan
 
Graph Analytics
Graph AnalyticsGraph Analytics
Graph Analytics
Khalid Salama
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
James Serra
 
MongoDB
MongoDBMongoDB
MongoDB
nikhil2807
 
Introduction to Neo4j for the Emirates & Bahrain
Introduction to Neo4j for the Emirates & BahrainIntroduction to Neo4j for the Emirates & Bahrain
Introduction to Neo4j for the Emirates & Bahrain
Neo4j
 
Introduction to PySpark
Introduction to PySparkIntroduction to PySpark
Introduction to PySpark
Russell Jurney
 
Key-Value NoSQL Database
Key-Value NoSQL DatabaseKey-Value NoSQL Database
Key-Value NoSQL Database
Heman Hosainpana
 
Graph database
Graph databaseGraph database
Graph database
Achintya Kumar
 
Batch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing DifferenceBatch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing Difference
jeetendra mandal
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Database
nehabsairam
 
An Introduction to NOSQL, Graph Databases and Neo4j
An Introduction to NOSQL, Graph Databases and Neo4jAn Introduction to NOSQL, Graph Databases and Neo4j
An Introduction to NOSQL, Graph Databases and Neo4j
Debanjan Mahata
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
Gokhan Atil
 
Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph Databases
DataStax
 
Intro to Neo4j and Graph Databases
Intro to Neo4j and Graph DatabasesIntro to Neo4j and Graph Databases
Intro to Neo4j and Graph Databases
Neo4j
 
Graph database Use Cases
Graph database Use CasesGraph database Use Cases
Graph database Use Cases
Max De Marzi
 
Neo4j Presentation
Neo4j PresentationNeo4j Presentation
Neo4j Presentation
Max De Marzi
 
Data Modeling with Neo4j
Data Modeling with Neo4jData Modeling with Neo4j
Data Modeling with Neo4j
Neo4j
 
Mining Data Streams
Mining Data StreamsMining Data Streams
Mining Data Streams
SujaAldrin
 
Introduction of Knowledge Graphs
Introduction of Knowledge GraphsIntroduction of Knowledge Graphs
Introduction of Knowledge Graphs
Jeff Z. Pan
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
James Serra
 
Introduction to Neo4j for the Emirates & Bahrain
Introduction to Neo4j for the Emirates & BahrainIntroduction to Neo4j for the Emirates & Bahrain
Introduction to Neo4j for the Emirates & Bahrain
Neo4j
 
Introduction to PySpark
Introduction to PySparkIntroduction to PySpark
Introduction to PySpark
Russell Jurney
 
Batch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing DifferenceBatch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing Difference
jeetendra mandal
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Database
nehabsairam
 
An Introduction to NOSQL, Graph Databases and Neo4j
An Introduction to NOSQL, Graph Databases and Neo4jAn Introduction to NOSQL, Graph Databases and Neo4j
An Introduction to NOSQL, Graph Databases and Neo4j
Debanjan Mahata
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
Gokhan Atil
 

Viewers also liked (15)

Getting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4jGetting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4j
Suroor Wijdan
 
Neo4j - 5 cool graph examples
Neo4j - 5 cool graph examplesNeo4j - 5 cool graph examples
Neo4j - 5 cool graph examples
Peter Neubauer
 
Introduction to Gremlin
Introduction to GremlinIntroduction to Gremlin
Introduction to Gremlin
Max De Marzi
 
Relational vs. Non-Relational
Relational vs. Non-RelationalRelational vs. Non-Relational
Relational vs. Non-Relational
PostgreSQL Experts, Inc.
 
Graph Database, a little connected tour - Castano
Graph Database, a little connected tour - CastanoGraph Database, a little connected tour - Castano
Graph Database, a little connected tour - Castano
Codemotion
 
Designing and Building a Graph Database Application – Architectural Choices, ...
Designing and Building a Graph Database Application – Architectural Choices, ...Designing and Building a Graph Database Application – Architectural Choices, ...
Designing and Building a Graph Database Application – Architectural Choices, ...
Neo4j
 
Graph Based Recommendation Systems at eBay
Graph Based Recommendation Systems at eBayGraph Based Recommendation Systems at eBay
Graph Based Recommendation Systems at eBay
DataStax Academy
 
Converting Relational to Graph Databases
Converting Relational to Graph DatabasesConverting Relational to Graph Databases
Converting Relational to Graph Databases
Antonio Maccioni
 
Relational to Graph - Import
Relational to Graph - ImportRelational to Graph - Import
Relational to Graph - Import
Neo4j
 
An Introduction to Graph Databases
An Introduction to Graph DatabasesAn Introduction to Graph Databases
An Introduction to Graph Databases
InfiniteGraph
 
Neo4j - graph database for recommendations
Neo4j - graph database for recommendationsNeo4j - graph database for recommendations
Neo4j - graph database for recommendations
proksik
 
Lju Lazarevic
Lju LazarevicLju Lazarevic
Lju Lazarevic
Connected Data World
 
NoSQL: Why, When, and How
NoSQL: Why, When, and HowNoSQL: Why, When, and How
NoSQL: Why, When, and How
BigBlueHat
 
Introduction to graph databases GraphDays
Introduction to graph databases  GraphDaysIntroduction to graph databases  GraphDays
Introduction to graph databases GraphDays
Neo4j
 
Data Mining: Graph mining and social network analysis
Data Mining: Graph mining and social network analysisData Mining: Graph mining and social network analysis
Data Mining: Graph mining and social network analysis
DataminingTools Inc
 
Getting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4jGetting started with Graph Databases & Neo4j
Getting started with Graph Databases & Neo4j
Suroor Wijdan
 
Neo4j - 5 cool graph examples
Neo4j - 5 cool graph examplesNeo4j - 5 cool graph examples
Neo4j - 5 cool graph examples
Peter Neubauer
 
Introduction to Gremlin
Introduction to GremlinIntroduction to Gremlin
Introduction to Gremlin
Max De Marzi
 
Graph Database, a little connected tour - Castano
Graph Database, a little connected tour - CastanoGraph Database, a little connected tour - Castano
Graph Database, a little connected tour - Castano
Codemotion
 
Designing and Building a Graph Database Application – Architectural Choices, ...
Designing and Building a Graph Database Application – Architectural Choices, ...Designing and Building a Graph Database Application – Architectural Choices, ...
Designing and Building a Graph Database Application – Architectural Choices, ...
Neo4j
 
Graph Based Recommendation Systems at eBay
Graph Based Recommendation Systems at eBayGraph Based Recommendation Systems at eBay
Graph Based Recommendation Systems at eBay
DataStax Academy
 
Converting Relational to Graph Databases
Converting Relational to Graph DatabasesConverting Relational to Graph Databases
Converting Relational to Graph Databases
Antonio Maccioni
 
Relational to Graph - Import
Relational to Graph - ImportRelational to Graph - Import
Relational to Graph - Import
Neo4j
 
An Introduction to Graph Databases
An Introduction to Graph DatabasesAn Introduction to Graph Databases
An Introduction to Graph Databases
InfiniteGraph
 
Neo4j - graph database for recommendations
Neo4j - graph database for recommendationsNeo4j - graph database for recommendations
Neo4j - graph database for recommendations
proksik
 
NoSQL: Why, When, and How
NoSQL: Why, When, and HowNoSQL: Why, When, and How
NoSQL: Why, When, and How
BigBlueHat
 
Introduction to graph databases GraphDays
Introduction to graph databases  GraphDaysIntroduction to graph databases  GraphDays
Introduction to graph databases GraphDays
Neo4j
 
Data Mining: Graph mining and social network analysis
Data Mining: Graph mining and social network analysisData Mining: Graph mining and social network analysis
Data Mining: Graph mining and social network analysis
DataminingTools Inc
 

Similar to Introduction to Graph Databases (20)

NoSQL, Neo4J for Java Developers , OracleWeek-2012
NoSQL, Neo4J for Java Developers , OracleWeek-2012NoSQL, Neo4J for Java Developers , OracleWeek-2012
NoSQL, Neo4J for Java Developers , OracleWeek-2012
Eugene Hanikblum
 
Graph Databases
Graph DatabasesGraph Databases
Graph Databases
thai
 
Spring Data Neo4j Intro SpringOne 2011
Spring Data Neo4j Intro SpringOne 2011Spring Data Neo4j Intro SpringOne 2011
Spring Data Neo4j Intro SpringOne 2011
jexp
 
Intro to Neo4j 2.0
Intro to Neo4j 2.0Intro to Neo4j 2.0
Intro to Neo4j 2.0
Peter Neubauer
 
managing big data
managing big datamanaging big data
managing big data
Suveeksha
 
Neo4j Introduction at Imperial College London
Neo4j Introduction at Imperial College LondonNeo4j Introduction at Imperial College London
Neo4j Introduction at Imperial College London
Michal Bachman
 
Intro to Neo4j with Ruby
Intro to Neo4j with RubyIntro to Neo4j with Ruby
Intro to Neo4j with Ruby
Max De Marzi
 
No Sql Movement
No Sql MovementNo Sql Movement
No Sql Movement
Ajit Koti
 
Grails goes Graph
Grails goes GraphGrails goes Graph
Grails goes Graph
darthvader42
 
Eifrem neo4j
Eifrem neo4jEifrem neo4j
Eifrem neo4j
Shridhar Joshi
 
Data Modeling with Neo4j
Data Modeling with Neo4jData Modeling with Neo4j
Data Modeling with Neo4j
Neo4j
 
Neo4j: Graph-like power
Neo4j: Graph-like powerNeo4j: Graph-like power
Neo4j: Graph-like power
Roman Rodomansky
 
NoSQL Overview
NoSQL OverviewNoSQL Overview
NoSQL Overview
adesso AG
 
Neo4j spatial-nosql-frankfurt
Neo4j spatial-nosql-frankfurtNeo4j spatial-nosql-frankfurt
Neo4j spatial-nosql-frankfurt
Peter Neubauer
 
10. Graph Databases
10. Graph Databases10. Graph Databases
10. Graph Databases
Fabio Fumarola
 
NoSQL overview #phptostart turin 11.07.2011
NoSQL overview #phptostart turin 11.07.2011NoSQL overview #phptostart turin 11.07.2011
NoSQL overview #phptostart turin 11.07.2011
David Funaro
 
Module 2.3 Document Databases in NoSQL Systems
Module 2.3 Document Databases in NoSQL SystemsModule 2.3 Document Databases in NoSQL Systems
Module 2.3 Document Databases in NoSQL Systems
NiramayKolalle
 
CSC 8101 Non Relational Databases
CSC 8101 Non Relational DatabasesCSC 8101 Non Relational Databases
CSC 8101 Non Relational Databases
sjwoodman
 
Neo4j
Neo4jNeo4j
Neo4j
Von Stark
 
Polyglot Persistence with MongoDB and Neo4j
Polyglot Persistence with MongoDB and Neo4jPolyglot Persistence with MongoDB and Neo4j
Polyglot Persistence with MongoDB and Neo4j
Corie Pollock
 
NoSQL, Neo4J for Java Developers , OracleWeek-2012
NoSQL, Neo4J for Java Developers , OracleWeek-2012NoSQL, Neo4J for Java Developers , OracleWeek-2012
NoSQL, Neo4J for Java Developers , OracleWeek-2012
Eugene Hanikblum
 
Graph Databases
Graph DatabasesGraph Databases
Graph Databases
thai
 
Spring Data Neo4j Intro SpringOne 2011
Spring Data Neo4j Intro SpringOne 2011Spring Data Neo4j Intro SpringOne 2011
Spring Data Neo4j Intro SpringOne 2011
jexp
 
managing big data
managing big datamanaging big data
managing big data
Suveeksha
 
Neo4j Introduction at Imperial College London
Neo4j Introduction at Imperial College LondonNeo4j Introduction at Imperial College London
Neo4j Introduction at Imperial College London
Michal Bachman
 
Intro to Neo4j with Ruby
Intro to Neo4j with RubyIntro to Neo4j with Ruby
Intro to Neo4j with Ruby
Max De Marzi
 
No Sql Movement
No Sql MovementNo Sql Movement
No Sql Movement
Ajit Koti
 
Data Modeling with Neo4j
Data Modeling with Neo4jData Modeling with Neo4j
Data Modeling with Neo4j
Neo4j
 
NoSQL Overview
NoSQL OverviewNoSQL Overview
NoSQL Overview
adesso AG
 
Neo4j spatial-nosql-frankfurt
Neo4j spatial-nosql-frankfurtNeo4j spatial-nosql-frankfurt
Neo4j spatial-nosql-frankfurt
Peter Neubauer
 
NoSQL overview #phptostart turin 11.07.2011
NoSQL overview #phptostart turin 11.07.2011NoSQL overview #phptostart turin 11.07.2011
NoSQL overview #phptostart turin 11.07.2011
David Funaro
 
Module 2.3 Document Databases in NoSQL Systems
Module 2.3 Document Databases in NoSQL SystemsModule 2.3 Document Databases in NoSQL Systems
Module 2.3 Document Databases in NoSQL Systems
NiramayKolalle
 
CSC 8101 Non Relational Databases
CSC 8101 Non Relational DatabasesCSC 8101 Non Relational Databases
CSC 8101 Non Relational Databases
sjwoodman
 
Polyglot Persistence with MongoDB and Neo4j
Polyglot Persistence with MongoDB and Neo4jPolyglot Persistence with MongoDB and Neo4j
Polyglot Persistence with MongoDB and Neo4j
Corie Pollock
 

More from Max De Marzi (20)

AI, Tariffs and Supply Chains in Knowledge Graphs
AI, Tariffs and Supply Chains in Knowledge GraphsAI, Tariffs and Supply Chains in Knowledge Graphs
AI, Tariffs and Supply Chains in Knowledge Graphs
Max De Marzi
 
DataDay 2023 Presentation
DataDay 2023 PresentationDataDay 2023 Presentation
DataDay 2023 Presentation
Max De Marzi
 
DataDay 2023 Presentation - Notes
DataDay 2023 Presentation - NotesDataDay 2023 Presentation - Notes
DataDay 2023 Presentation - Notes
Max De Marzi
 
Developer Intro Deck-PowerPoint - Download for Speaker Notes
Developer Intro Deck-PowerPoint - Download for Speaker NotesDeveloper Intro Deck-PowerPoint - Download for Speaker Notes
Developer Intro Deck-PowerPoint - Download for Speaker Notes
Max De Marzi
 
Outrageous Ideas for Graph Databases
Outrageous Ideas for Graph DatabasesOutrageous Ideas for Graph Databases
Outrageous Ideas for Graph Databases
Max De Marzi
 
Neo4j Training Cypher
Neo4j Training CypherNeo4j Training Cypher
Neo4j Training Cypher
Max De Marzi
 
Neo4j Training Modeling
Neo4j Training ModelingNeo4j Training Modeling
Neo4j Training Modeling
Max De Marzi
 
Neo4j Training Introduction
Neo4j Training IntroductionNeo4j Training Introduction
Neo4j Training Introduction
Max De Marzi
 
Detenga el fraude complejo con Neo4j
Detenga el fraude complejo con Neo4jDetenga el fraude complejo con Neo4j
Detenga el fraude complejo con Neo4j
Max De Marzi
 
Data Modeling Tricks for Neo4j
Data Modeling Tricks for Neo4jData Modeling Tricks for Neo4j
Data Modeling Tricks for Neo4j
Max De Marzi
 
Fraud Detection and Neo4j
Fraud Detection and Neo4j Fraud Detection and Neo4j
Fraud Detection and Neo4j
Max De Marzi
 
Detecion de Fraude con Neo4j
Detecion de Fraude con Neo4jDetecion de Fraude con Neo4j
Detecion de Fraude con Neo4j
Max De Marzi
 
Neo4j Data Science Presentation
Neo4j Data Science PresentationNeo4j Data Science Presentation
Neo4j Data Science Presentation
Max De Marzi
 
Neo4j Stored Procedure Training Part 2
Neo4j Stored Procedure Training Part 2Neo4j Stored Procedure Training Part 2
Neo4j Stored Procedure Training Part 2
Max De Marzi
 
Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1
Max De Marzi
 
Decision Trees in Neo4j
Decision Trees in Neo4jDecision Trees in Neo4j
Decision Trees in Neo4j
Max De Marzi
 
Neo4j y Fraude Spanish
Neo4j y Fraude SpanishNeo4j y Fraude Spanish
Neo4j y Fraude Spanish
Max De Marzi
 
Data modeling with neo4j tutorial
Data modeling with neo4j tutorialData modeling with neo4j tutorial
Data modeling with neo4j tutorial
Max De Marzi
 
Neo4j Fundamentals
Neo4j FundamentalsNeo4j Fundamentals
Neo4j Fundamentals
Max De Marzi
 
Fraud Detection Class Slides
Fraud Detection Class SlidesFraud Detection Class Slides
Fraud Detection Class Slides
Max De Marzi
 
AI, Tariffs and Supply Chains in Knowledge Graphs
AI, Tariffs and Supply Chains in Knowledge GraphsAI, Tariffs and Supply Chains in Knowledge Graphs
AI, Tariffs and Supply Chains in Knowledge Graphs
Max De Marzi
 
DataDay 2023 Presentation
DataDay 2023 PresentationDataDay 2023 Presentation
DataDay 2023 Presentation
Max De Marzi
 
DataDay 2023 Presentation - Notes
DataDay 2023 Presentation - NotesDataDay 2023 Presentation - Notes
DataDay 2023 Presentation - Notes
Max De Marzi
 
Developer Intro Deck-PowerPoint - Download for Speaker Notes
Developer Intro Deck-PowerPoint - Download for Speaker NotesDeveloper Intro Deck-PowerPoint - Download for Speaker Notes
Developer Intro Deck-PowerPoint - Download for Speaker Notes
Max De Marzi
 
Outrageous Ideas for Graph Databases
Outrageous Ideas for Graph DatabasesOutrageous Ideas for Graph Databases
Outrageous Ideas for Graph Databases
Max De Marzi
 
Neo4j Training Cypher
Neo4j Training CypherNeo4j Training Cypher
Neo4j Training Cypher
Max De Marzi
 
Neo4j Training Modeling
Neo4j Training ModelingNeo4j Training Modeling
Neo4j Training Modeling
Max De Marzi
 
Neo4j Training Introduction
Neo4j Training IntroductionNeo4j Training Introduction
Neo4j Training Introduction
Max De Marzi
 
Detenga el fraude complejo con Neo4j
Detenga el fraude complejo con Neo4jDetenga el fraude complejo con Neo4j
Detenga el fraude complejo con Neo4j
Max De Marzi
 
Data Modeling Tricks for Neo4j
Data Modeling Tricks for Neo4jData Modeling Tricks for Neo4j
Data Modeling Tricks for Neo4j
Max De Marzi
 
Fraud Detection and Neo4j
Fraud Detection and Neo4j Fraud Detection and Neo4j
Fraud Detection and Neo4j
Max De Marzi
 
Detecion de Fraude con Neo4j
Detecion de Fraude con Neo4jDetecion de Fraude con Neo4j
Detecion de Fraude con Neo4j
Max De Marzi
 
Neo4j Data Science Presentation
Neo4j Data Science PresentationNeo4j Data Science Presentation
Neo4j Data Science Presentation
Max De Marzi
 
Neo4j Stored Procedure Training Part 2
Neo4j Stored Procedure Training Part 2Neo4j Stored Procedure Training Part 2
Neo4j Stored Procedure Training Part 2
Max De Marzi
 
Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1Neo4j Stored Procedure Training Part 1
Neo4j Stored Procedure Training Part 1
Max De Marzi
 
Decision Trees in Neo4j
Decision Trees in Neo4jDecision Trees in Neo4j
Decision Trees in Neo4j
Max De Marzi
 
Neo4j y Fraude Spanish
Neo4j y Fraude SpanishNeo4j y Fraude Spanish
Neo4j y Fraude Spanish
Max De Marzi
 
Data modeling with neo4j tutorial
Data modeling with neo4j tutorialData modeling with neo4j tutorial
Data modeling with neo4j tutorial
Max De Marzi
 
Neo4j Fundamentals
Neo4j FundamentalsNeo4j Fundamentals
Neo4j Fundamentals
Max De Marzi
 
Fraud Detection Class Slides
Fraud Detection Class SlidesFraud Detection Class Slides
Fraud Detection Class Slides
Max De Marzi
 

Recently uploaded (20)

The 2025 Digital Adoption Blueprint.pptx
The 2025 Digital Adoption Blueprint.pptxThe 2025 Digital Adoption Blueprint.pptx
The 2025 Digital Adoption Blueprint.pptx
aptyai
 
Building Agents with LangGraph & Gemini
Building Agents with LangGraph &  GeminiBuilding Agents with LangGraph &  Gemini
Building Agents with LangGraph & Gemini
HusseinMalikMammadli
 
What’s New in Web3 Development Trends to Watch in 2025.pptx
What’s New in Web3 Development Trends to Watch in 2025.pptxWhat’s New in Web3 Development Trends to Watch in 2025.pptx
What’s New in Web3 Development Trends to Watch in 2025.pptx
Lisa ward
 
Fully Open-Source Private Clouds: Freedom, Security, and Control
Fully Open-Source Private Clouds: Freedom, Security, and ControlFully Open-Source Private Clouds: Freedom, Security, and Control
Fully Open-Source Private Clouds: Freedom, Security, and Control
ShapeBlue
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification o...
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification o...State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification o...
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification o...
Ivan Ruchkin
 
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AIAI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
Buhake Sindi
 
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AISAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
Peter Spielvogel
 
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptxECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
Jasper Oosterveld
 
2025-05-22_Automate__Motivate_Spiff_Meets_Marketing_Cloud.pptx
2025-05-22_Automate__Motivate_Spiff_Meets_Marketing_Cloud.pptx2025-05-22_Automate__Motivate_Spiff_Meets_Marketing_Cloud.pptx
2025-05-22_Automate__Motivate_Spiff_Meets_Marketing_Cloud.pptx
katalinjordans2
 
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ..."AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
Fwdays
 
Security Operations and the Defense Analyst - Splunk Certificate
Security Operations and the Defense Analyst - Splunk CertificateSecurity Operations and the Defense Analyst - Splunk Certificate
Security Operations and the Defense Analyst - Splunk Certificate
VICTOR MAESTRE RAMIREZ
 
Measuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI SuccessMeasuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI Success
Nikki Chapple
 
Build your own NES Emulator... with Kotlin
Build your own NES Emulator... with KotlinBuild your own NES Emulator... with Kotlin
Build your own NES Emulator... with Kotlin
Artur Skowroński
 
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Nikki Chapple
 
Multistream in SIP and NoSIP @ OpenSIPS Summit 2025
Multistream in SIP and NoSIP @ OpenSIPS Summit 2025Multistream in SIP and NoSIP @ OpenSIPS Summit 2025
Multistream in SIP and NoSIP @ OpenSIPS Summit 2025
Lorenzo Miniero
 
Kubernetes Cloud Native Indonesia Meetup - May 2025
Kubernetes Cloud Native Indonesia Meetup - May 2025Kubernetes Cloud Native Indonesia Meetup - May 2025
Kubernetes Cloud Native Indonesia Meetup - May 2025
Prasta Maha
 
Introducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and ARIntroducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and AR
Safe Software
 
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure ModesCognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Dr. Tathagat Varma
 
John Carmack’s Notes From His Upper Bound 2025 Talk
John Carmack’s Notes From His Upper Bound 2025 TalkJohn Carmack’s Notes From His Upper Bound 2025 Talk
John Carmack’s Notes From His Upper Bound 2025 Talk
Razin Mustafiz
 
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
James Anderson
 
The 2025 Digital Adoption Blueprint.pptx
The 2025 Digital Adoption Blueprint.pptxThe 2025 Digital Adoption Blueprint.pptx
The 2025 Digital Adoption Blueprint.pptx
aptyai
 
Building Agents with LangGraph & Gemini
Building Agents with LangGraph &  GeminiBuilding Agents with LangGraph &  Gemini
Building Agents with LangGraph & Gemini
HusseinMalikMammadli
 
What’s New in Web3 Development Trends to Watch in 2025.pptx
What’s New in Web3 Development Trends to Watch in 2025.pptxWhat’s New in Web3 Development Trends to Watch in 2025.pptx
What’s New in Web3 Development Trends to Watch in 2025.pptx
Lisa ward
 
Fully Open-Source Private Clouds: Freedom, Security, and Control
Fully Open-Source Private Clouds: Freedom, Security, and ControlFully Open-Source Private Clouds: Freedom, Security, and Control
Fully Open-Source Private Clouds: Freedom, Security, and Control
ShapeBlue
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification o...
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification o...State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification o...
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification o...
Ivan Ruchkin
 
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AIAI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
AI in Java - MCP in Action, Langchain4J-CDI, SmallRye-LLM, Spring AI
Buhake Sindi
 
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AISAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
SAP Sapphire 2025 ERP1612 Enhancing User Experience with SAP Fiori and AI
Peter Spielvogel
 
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptxECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
ECS25 - The adventures of a Microsoft 365 Platform Owner - Website.pptx
Jasper Oosterveld
 
2025-05-22_Automate__Motivate_Spiff_Meets_Marketing_Cloud.pptx
2025-05-22_Automate__Motivate_Spiff_Meets_Marketing_Cloud.pptx2025-05-22_Automate__Motivate_Spiff_Meets_Marketing_Cloud.pptx
2025-05-22_Automate__Motivate_Spiff_Meets_Marketing_Cloud.pptx
katalinjordans2
 
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ..."AI in the browser: predicting user actions in real time with TensorflowJS", ...
"AI in the browser: predicting user actions in real time with TensorflowJS", ...
Fwdays
 
Security Operations and the Defense Analyst - Splunk Certificate
Security Operations and the Defense Analyst - Splunk CertificateSecurity Operations and the Defense Analyst - Splunk Certificate
Security Operations and the Defense Analyst - Splunk Certificate
VICTOR MAESTRE RAMIREZ
 
Measuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI SuccessMeasuring Microsoft 365 Copilot and Gen AI Success
Measuring Microsoft 365 Copilot and Gen AI Success
Nikki Chapple
 
Build your own NES Emulator... with Kotlin
Build your own NES Emulator... with KotlinBuild your own NES Emulator... with Kotlin
Build your own NES Emulator... with Kotlin
Artur Skowroński
 
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Protecting Your Sensitive Data with Microsoft Purview - IRMS 2025
Nikki Chapple
 
Multistream in SIP and NoSIP @ OpenSIPS Summit 2025
Multistream in SIP and NoSIP @ OpenSIPS Summit 2025Multistream in SIP and NoSIP @ OpenSIPS Summit 2025
Multistream in SIP and NoSIP @ OpenSIPS Summit 2025
Lorenzo Miniero
 
Kubernetes Cloud Native Indonesia Meetup - May 2025
Kubernetes Cloud Native Indonesia Meetup - May 2025Kubernetes Cloud Native Indonesia Meetup - May 2025
Kubernetes Cloud Native Indonesia Meetup - May 2025
Prasta Maha
 
Introducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and ARIntroducing FME Realize: A New Era of Spatial Computing and AR
Introducing FME Realize: A New Era of Spatial Computing and AR
Safe Software
 
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure ModesCognitive Chasms - A Typology of GenAI Failure Failure Modes
Cognitive Chasms - A Typology of GenAI Failure Failure Modes
Dr. Tathagat Varma
 
John Carmack’s Notes From His Upper Bound 2025 Talk
John Carmack’s Notes From His Upper Bound 2025 TalkJohn Carmack’s Notes From His Upper Bound 2025 Talk
John Carmack’s Notes From His Upper Bound 2025 Talk
Razin Mustafiz
 
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
GDG Cloud Southlake #43: Tommy Todd: The Quantum Apocalypse: A Looming Threat...
James Anderson
 

Introduction to Graph Databases

  • 1. Introduction to Graph Databases Chicago Graph Database Meet-Up Max De Marzi
  • 2. About Me Built the Neography Gem (Ruby Wrapper to the Neo4j REST API) Playing with Neo4j since 10/2009 • My Blog: http://maxdemarzi.com • Find me on Twitter: @maxdemarzi • Email me: [email protected] • GitHub: http://github.com/maxdemarzi
  • 3. Agenda • Trends in Data • NOSQL • What is a Graph? • What is a Graph Database? • What is Neo4j?
  • 5. Data is getting bigger: “Every 2 days we create as much information as we did up to 2003” – Eric Schmidt, Google
  • 6. Data is more connected: • Text (content) • HyperText (added pointers) • RSS (joined those pointers) • Blogs (added pingbacks) • Tagging (grouped related data) • RDF (described connected data) • GGG (content + pointers + relationships + descriptions)
  • 7. Data is more Semi-Structured: • If you tried to collect all the data of every movie ever made, how would you model it? • Actors, Characters, Locations, Dates, Costs, Ratings, Showings, Ticket Sales, etc.
  • 9. Less than 10% of the NOSQL Vendors
  • 10. Key Value Stores • Most Based on Dynamo: Amazon Highly Available Key-Value Store • Data Model: – Global key-value mapping – Big scalable HashMap – Highly fault tolerant (typically) • Examples: – Redis, Riak, Voldemort
  • 11. Key Value Stores: Pros and Cons • Pros: – Simple data model – Scalable • Cons – Create your own “foreign keys” – Poor for complex data
  • 12. Column Family • Most Based on BigTable: Google’s Distributed Storage System for Structured Data • Data Model: – A big table, with column families – Map Reduce for querying/processing • Examples: – HBase, HyperTable, Cassandra
  • 13. Column Family: Pros and Cons • Pros: – Supports Simi-Structured Data – Naturally Indexed (columns) – Scalable • Cons – Poor for interconnected data
  • 14. Document Databases • Data Model: – A collection of documents – A document is a key value collection – Index-centric, lots of map-reduce • Examples: – CouchDB, MongoDB
  • 15. Document Databases: Pros and Cons • Pros: – Simple, powerful data model – Scalable • Cons – Poor for interconnected data – Query model limited to keys and indexes – Map reduce for larger queries
  • 16. Graph Databases • Data Model: – Nodes and Relationships • Examples: – Neo4j, OrientDB, InfiniteGraph, AllegroGraph
  • 17. Graph Databases: Pros and Cons • Pros: – Powerful data model, as general as RDBMS – Connected data locally indexed – Easy to query • Cons – Sharding ( lots of people working on this) • Scales UP reasonably well – Requires rewiring your brain
  • 18. Living in a NOSQL World RDBMS Graph Databases Complexity Document Databases BigTable Clones Key-Value Relational Store Databases 90% of Use Cases Size
  • 19. What is a Graph?
  • 20. What is a Graph? • An abstract representation of a set of objects where some pairs are connected by links. Object (Vertex, Node) Link (Edge, Arc, Relationship)
  • 21. Different Kinds of Graphs • Undirected Graph • Directed Graph • Pseudo Graph • Multi Graph • Hyper Graph
  • 22. More Kinds of Graphs • Weighted Graph • Labeled Graph • Property Graph
  • 23. What is a Graph Database? • A database with an explicit graph structure • Each node knows its adjacent nodes • As the number of nodes increases, the cost of a local step (or hop) remains the same • Plus an Index for lookups
  • 24. Compared to Relational Databases Optimized for aggregation Optimized for connections
  • 25. Compared to Key Value Stores Optimized for simple look-ups Optimized for traversing connected data
  • 26. Compared to Key Value Stores Optimized for “trees” of data Optimized for seeing the forest and the trees, and the branches, and the trunks
  • 28. What is Neo4j? • A Graph Database + Lucene Index • Property Graph • Full ACID (atomicity, consistency, isolation, durability) • High Availability (with Enterprise Edition) • 32 Billion Nodes, 32 Billion Relationships, 64 Billion Properties • Embedded Server • REST API
  • 29. Good For • Highly connected data (social networks) • Recommendations (e-commerce) • Path Finding (how do I know you?) • A* (Least Cost path) • Data First Schema (bottom-up, but you still need to design)
  • 31. // then traverse to find results start n=(people-index, name, “Andreas”) match (n)--()--(foaf) return foaf n
  • 32. Cypher Pattern Matching Query Language (like SQL for graphs) // get node 0 start a=(0) return a // traverse from node 1 start a=(1) match (a)-->(b) return b // return friends of friends start a=(1) match (a)--()--(c) return c
  • 33. Gremlin A Graph Scripting DSL (groovy-based) // get node 0 g.v(0) // nodes with incoming relationship g.v(0).in // outgoing “KNOWS” relationship g.v(0).out(“KNOWS”)
  • 34. If you’ve ever • Joined more than 7 tables together • Modeled a graph in a table • Written a recursive CTE • Tried to write some crazy stored procedure with multiple recursive self and inner joins You should use Neo4j
  • 35. Language LanguageCountry Country language_code language_code country_code language_name country_code country_name word_count primary flag_uri Language Country name name IS_SPOKEN_IN code code word_count as_primary flag_uri
  • 36. name: “Canada” languages_spoken: “[ „English‟, „French‟ ]” language:“English” spoken_in name: “USA” name: “Canada” language:“French” spoken_in name: “France”
  • 37. Country name flag_uri language_name number_of_words yes_in_langauge no_in_language currency_code currency_name Country Language name name flag_uri SPEAKS number_of_words yes no Currency code name
  • 40. console.neo4j.org Try it right now: start n=node(*) match n-[r:LOVES]->m return n, type(r), m Notice the two nodes in red, they are your result set.
  • 41. What does a Graph look like?

Editor's Notes

  • #22: An undirected graph is one in which edges have no orientation. The edge (a, b) is identical to the edge (b, a).A directed graph or digraph is an ordered pair D = (V, A)A pseudo graph is a graph with loopsA multi graph allows for multiple edges between nodesA hyper graph allows an edge to join more than two nodes
  • #23: A weighted graph has a number assigned to each edgeAlabeled graph has a label assigned to each node or edgeA property graph has keys and values for each node or edge
  • #29: Atomic = all or nothing, consistent = stay consistent from one tx to another, isolation = no tx will mess with another tx, durability = once tx committed, it stays