graphdb
TRANSCRIPT
Internet Programming IIYildiz Technical University 2015
Graph Databases
{
"name” : "Omer Taskin",
"company” : "eBay Inc.",
"title” : "Software Engineer"
}
OUTLINE
• NoSQL
• Graph
• Graph Algorithms
• Graph DBs
• Neo4j
Data is
everything!
in the
Data is getting bigger day by day
Database
is a thing where data is kept and managed!
Database
is a thing where data is kept and managed!
files are databases too
Relational Database(s)RDBMS
supports JOIN(s) between tables
invented @IBM in 1970
SQL is
Structured Query Language
is a standard language for accessing databases
•SQL became a standard;–American National Standards Institute (ANSI) in 1986– International Organization for Standardization (ISO) in 1987
Relational Database(s)RDBMS
Every table has to be in a schema
Data has to be stored into table(s)
NoSQL
• means Not Only SQL
• Started to use in 2009 @ last.fm
• A Database Management System
• Non-relational!
• No Joins!
• Mostly non-transactional
Graph TheoryHistory
Seven bridges of Königsberg (Germany)
Found @in 1736
Graph TheoryNode Edge And Property
Graphs usually are not small like that
Graph TheoryGraphDB vs RDBMS
fetching by Join
Graph database
Graph AlgorithmsShortest Path
Graph AlgorithmsGraph Traversal
Network
Recommendations
Social
Security
Graph DatabasesUse Cases
Network and IT Operations Management
The interconnected physical, virtual, and application layers of a network are perfectly modeled in a comprehensive graph.
Queries:
Quality-of-Service Mapping,
Impact Analysis,
Root Cause Analysis,
Asset Management
Graph DatabasesUse Cases
Social
Family, friends and followers extend into a social graph which reveals patterns of similar behavior, influence, and implicit groups.
Queries:
Friend Recommendations,
Sharing & Collaboration,
Influencer Analysis
Graph DatabasesUse Cases
Recommendations
Connect the dots of seemingly unrelated interests and relationships to make recommendations that balance fresh with familiar.
Queries :
Professional Recommendations
Product,
Social,
Service
Graph DatabasesUse Cases
Identity and Access Management
Who you are, how you belong, and what you’re permitted depends upon the relationships between you, an organization, and a system.
Queries :
Interconnected Group Organization,
Access Management,
Provenance
Graph DatabasesUse Cases
Graph Databases
Most popular graph database
Open source
Implemented in Java
Neo4j
Neo4j
Cypher is query language of Neo4j
Cypher
Neo4j
Finding nodes
MATCH (node : Person) RETURN node
Creating node
CREATE (person : Person {name = “Omer”})
Cypher
Neo4j
Creating relation for existing node
MATCH (me : Person {name = “Omer”})
CREATE (me)-[:FRIEND]->(friend : Person {name = “Seda”})
Cypher
Neo4j
Fetching friends of me
MATCH (me : Person {name = “Omer”})-[:FRIEND]->(friend : Person)
RETURN me, friend;
Cypher
Neo4j
Fetching friends of friends of fiends of me
MATCH (me : Person {name = “Omer”})-[f1:FRIEND] -[f2:FRIEND] -[f3:FRIEND]->(f4: Person)
RETURN me, f1, f2, f3, f4;
Cypher