Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Application Modelingwith Graph Databases              http://joind.in/6694
@josh_adell• Software developer: PHP, Javascript, SQL• http://www.dunnwell.com• http://blog.everymansoftware.com• http://g...
The Problem
The Solution?> -- First degree> SELECT actor_name FROM cast WHERE movie_title IN (SELECT DISTINCT movie_titleFROM cast WHE...
The TruthRelational databases arent very good with relationships                       Data                      RDBMs
RDBs Use Set Math
Try again?
Right Tool for the Job          =
Warning: Computer Science Ahead     A graph is an ordered pair G = (V, E)       where V is a set of vertices and          ...
Graphs are Everywhere
Relational Databases are Graphs!
Everything is connected
Some Graph Use Cases•   Social networking•   Manufacturing•   Map directions•   Geo-spatial algorithms•   Fraud detection•...
Graphs are "Whiteboard-Friendly"   Nouns => nodes, Verbs => relationships
Back to BaconSTART s=node:actors(name="Keanu Reeves"),      e=node:actors(name="Kevin Bacon")MATCH p = shortestPath( s-[*]...
ACL• Users can belong to groups• Groups can belong to groups• Groups and users have permissions on objects  o read  o writ...
START u=node:users(name="User 3")MATCH u-[:belongs_to*]->gRETURN g                                    http://tinyurl.com/c...
START u=node:users(name="User 2"),      o=node:objects(name="Home")MATCH u-[:belongs_to*0..]->g,      g-[:can_read]->oRETU...
START u=node:users(name="User 3"),      o=node:objects(name="Users 1 Blog")MATCH u-[:belongs_to*0..]->g,      g-[:can_read...
Real Life Example• Companies have brands, locations, location groups• Brands have locations, location groups• Location gro...
START c=node:companies(name="Company 1")MATCH c-[:HAS*]->lWHERE l.type = locationRETURN l ORDER BY l.name                 ...
START b=node:brands(name="Brand 1")MATCH b<-[:HAS*]-c-[:HAS*]->l<-[h?:HAS*]-bWHERE h IS NULL AND l.type=locationRETURN l O...
Tweet    @chicken_techwe should be using graph dbs!
But Wait...Theres More!•   Mutating Cypher (insert, update)•   Indexing (auto, full-text, spatial)•   Batches and Transact...
Where fore art thou, RDB?•   Aggregation•   Ordered data•   Truly tabular data•   Few or clearly defined relationships
Questions?
Resources• http://joind.in/6694• http://neo4j.org• http://docs.neo4j.org• http://www.youtube.com/watch?v=UodTzseLh04• http...
Resources• http://joind.in/6694• http://neo4j.org• http://docs.neo4j.org• http://www.youtube.com/watch?v=UodTzseLh04•
Upcoming SlideShare
Loading in …5
×

Resources• http://joind.in/6694• http://neo4j.org• http://docs.neo4j.org• http://www.youtube.com/watch?v=UodTzseLh04• Application Modeling with Graph Databases

7,612 views

Published on

Resources• http://joind.in/6694• http://neo4j.org• http://docs.neo4j.org• http://www.youtube.com/watch?v=UodTzseLh04• http://github.com/jadell/neo4jphp• http://joshadell.com• josh.adell@gmail.com• @josh_adell• Google+, Facebook, LinkedIn

Published in: Technology, Business
  • Be the first to comment

×