# Betting the Company ## (Literally) on a # Graph Database ### Tips, Tricks, and Lessons Learned [Aseem Kishore](http://aseemk.com/)
Jan–Nov 2013
[![](/images/neo4j-lessons-learned/fiftythree-hp.png)](http://www.fiftythree.com/)
[![](/images/neo4j-lessons-learned/thingdom-hp-gasi.png)](http://www.thethingdom.com/)
[![](/images/neo4j-lessons-learned/zoomit-hp.png)](http://zoom.it/)
![](/images/neo4j-lessons-learned/calvin-hobbes-ignorance.jpg)
[![](/images/neo4j-lessons-learned/neo4j-viz.png)](http://www.neo4j.org/)
![](/images/neo4j-lessons-learned/thingdom-graph-basic.png)
![](/images/neo4j-lessons-learned/thingdom-recommendations.png)
![](/images/neo4j-lessons-learned/meme-camera-phone.jpg)
[![](/images/neo4j-lessons-learned/gasi.jpg)](http://gasi.ch/) Daniel Gasienica
[@gasi](https://twitter.com/gasi)
# So… ##   # Just what is a # graph database?
![](/images/neo4j-lessons-learned/GraphDatabase_PropertyGraph.png)
![](/images/neo4j-lessons-learned/relational-to-graph.png)
 
By definition, a graph database is any storage system that provides index-free adjacency.
 
This means that every element contains a direct pointer to its adjacent element and no index lookups are necessary.
![](/images/neo4j-lessons-learned/meme-joins.jpg)
# Okay... ##   # Let's talk about # what we learned
# Our usage   ## **Node.js** + ## **REST API** + ## **Cypher**
[![](/images/neo4j-lessons-learned/thingdom-node-neo4j.png)](https://github.com/thingdom/node-neo4j)
![](/images/neo4j-lessons-learned/thingdom-graph-basic.png)
# What we learned
  • Unique, expressive relationship types
![](/images/neo4j-lessons-learned/thingdom-people-stats.png)
![](/images/neo4j-lessons-learned/thingdom-graph-stats.png)
![](/images/neo4j-lessons-learned/webadmin-user-stats.png)
# What we learned
  • Unique, expressive relationship types
  • Cache stats where possible
![](/images/neo4j-lessons-learned/thingdom-graph-events.png)
# What we learned
  • Unique, expressive relationship types
  • Cache stats where possible
  • Capture history through event nodes
![](/images/neo4j-lessons-learned/thingdom-graph-suggestions.png)
# What we learned
  • Unique, expressive relationship types
  • Cache stats where possible
  • Capture history through event nodes
  • First-class objects ⇒ nodes, not rels
![](/images/neo4j-lessons-learned/webadmin-thing-categories.png)
![](/images/neo4j-lessons-learned/thingdom-graph-categories.png)
# What we learned
  • Unique, expressive relationship types
  • Cache stats where possible
  • Capture history through event nodes
  • First-class objects ⇒ nodes, not rels
  • Connected data ⇒ nodes, not props
# What we learned
  • Unique, 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
# Neo4j 2.0+
  • Labels & constraints
  • Relationship type grouping
  • Transactional Cypher
  • Automatic sharding?
[![](/images/neo4j-lessons-learned/fiftythree-hp.png)](http://www.fiftythree.com/)
## And check out...

(MySQL)—[:to]—>(Neo4j)

## A DBA Perspective ## Dave Stern @ 11:30
# Thanks!   ### Twitter: [@aseemk](https://twitter.com/aseemk) ### GitHub: [@aseemk](https://github.com/aseemk) ### Email: [aseem.kishore@gmail.com](mailto:aseem.kishore@gmail.com)   Questions?