Download presentation
Presentation is loading. Please wait.
Published byKari Kapulainen Modified over 5 years ago
1
Christopher Thielen, Lead Application Developer, DSS IT
Graph Databases Christopher Thielen, Lead Application Developer, DSS IT
2
The Breadth of the NoSQL Movement
3
Relationships Are Data
Join Table as a hack.
4
Graph Concepts Nodes Edges Properties
Relationship complexity grows linearly, not exponentially
5
Cypher vs SQL: Schema creation
CREATE TABLE `students` ( `id` int(11) NOT NULL, `name` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) ) Not needed.
6
Cypher vs SQL: Insert data
INSERT INTO students (`name`) values ('Christopher'); CREATE (n:Student {name: 'Christopher'})
7
Cypher vs SQL: Query all students
SELECT * FROM students; MATCH (n:Student) RETURN n
8
Cypher vs SQL: Enroll a student
INSERT INTO enrollments (`student_id`, `class_id`) values (1, 5); MATCH (s:Student),(c:Class) WHERE s.name = 'Christopher' AND c.name = 'From SQL to NoSQL' CREATE (s)-[r:ENROLLED_IN]->(c) RETURN type(r)
9
Cypher vs SQL: Class roster
SELECT * FROM students LEFT JOIN enrollments ON students.id = enrollments.student_id LEFT JOIN classes ON classes.id = enrollments.class_id WHERE classes.title = 'From SQL to NoSQL'; MATCH (s:Student)-[:ENROLLED_IN]->(c:Class{name:'From SQL to NoSQL'}) RETURN s, c
10
Cypher vs SQL: Recommendations
??? (Yes, it is possible.) MATCH (Class{name:'From SQL to NoSQL'})<-[:ENROLLED_IN]-(Student)-[:ENROLLED_IN]->(c) RETURN c, count(c)
11
Demo
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.