betting the company (literally) on a graph database – aseem kishore @ graphconnect ny 2013

40
BETTING THE COMPANY (LITERALLY) ON A GRAPH DATABASE TIPS, TRICKS, AND LESSONS LEARNED Aseem Kishore Jan–Nov 2013

Upload: neo4j-the-open-source-graph-database

Post on 27-Jan-2015

104 views

Category:

Technology


0 download

DESCRIPTION

Aseem Kishore of FiftyThree will be speaking about his experiences building an early-stage startup, The Thingdom, on Neo4j and Node.js: why he and his team chose to build on a graph database, how they did it, and what lessons they learned along the way.

TRANSCRIPT

Page 1: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

BETTING THE COMPANY(LITERALLY) ON A

GRAPH DATABASETIPS, TRICKS, AND LESSONS LEARNED

Aseem KishoreJan–Nov 2013

Page 5: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 7: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 8: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 9: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

START user=node(1), other=node(2)

MATCH (user) -[r1:has|wants]-> (thing) <-[r2:has|wants]- (other)

WHERE TYPE(r1) <> TYPE(r2)

RETURN TYPE(r1), TYPE(r2), thing

Page 10: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 11: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

Daniel Gasienica

@gasi

Page 12: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

SO…

JUST WHAT IS AGRAPH DATABASE?

Page 13: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 14: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

# adjacency list:

nodes = List<Node>

neighbors = Map<Node, List<Node>>

neighbors[node1].add(node2)

# adjacency matrix:

nodes = List<Node>

connections = Map<Node, Map<Node, bool>>

connections[node1][node2] = true

Page 15: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 16: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 17: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 18: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 19: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

OKAY...

LET'S TALK ABOUTWHAT WE LEARNED

Page 20: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

OUR USAGE

NODE.JS+

REST API+

CYPHER

Page 22: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 23: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

WHAT WE LEARNEDUnique, expressive relationship types

Page 24: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 25: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 26: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 27: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

WHAT WE LEARNEDUnique, expressive relationship types

Cache stats where possible

Page 28: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 29: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

WHAT WE LEARNEDUnique, expressive relationship types

Cache stats where possible

Capture history through event nodes

Page 30: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 31: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

WHAT WE LEARNEDUnique, expressive relationship types

Cache stats where possible

Capture history through event nodes

First-class objects nodes, not rels

Page 32: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 33: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 34: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

WHAT WE LEARNEDUnique, expressive relationship types

Cache stats where possible

Capture history through event nodes

First-class objects nodes, not rels

Connected data nodes, not props

Page 35: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013
Page 36: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

WHAT WE LEARNEDUnique, expressive relationship types

Cache stats where possible

Capture history through event nodes

First-class objects nodes, not rels

Connected data nodes, not props

Maintain linked lists for O(1) queries

Page 37: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

NEO4J 2.0+Labels & constraints

Relationship type grouping

Transactional Cypher

Automatic sharding?

Page 39: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

AND CHECK OUT...

(MySQL)—[:TO]—>(Neo4j)A DBA PERSPECTIVEDAVE STERN @ 11:30

Page 40: Betting the Company (Literally) on a Graph Database – Aseem Kishore @ GraphConnect NY 2013

THANKS!

TWITTER: @ASEEMKGITHUB: @ASEEMK

EMAIL: [email protected]

Questions?