Transcript Neo4j

Neo4j
Adam Foust
Road Map
•
•
•
•
•
Introduction to Neo4j
NoSQL databases
Graph databases
How Neo4j works
Comparison
Introducing Neo4j
•
•
•
•
Introduced in 2010
Open source
Java-based
NoSQL Graph Database
NoSQL databases
• Four classes of NoSQL databases
– Key-value store
• Amazon’s Simple DB
– Column-family or big table databases
• Google’s Big Table
• Apache Cassandra database
– Document-oriented
• MongoDB
– Graph Databases
• Neo4j
Graph Database
• Neo4j is a graph database
• Database full of linked nodes
• Stores data as nodes and relationships
Graph Database (cont.)
• Nodes represent entities
• Edges represent relationships
•
•
•
•
Connections between data are explored
Faster for associative data sets
Intuitive
Optimal for searching social network data
How Neo4j Works
Storing Objects
• Domain objects take a node
• Jo4neo framework 
public class Person {
//used by jo4neo
transient Nodeid node;
//simple property
@neo String firstName;
//helps you store a java.util.Date
to neo4j
@neo Date date;
// jo4neo will index for you
@neo(index=true) String email;
// many to many relation
@neo Collection<role> roles;
/* normal class oriented
* programming stuff goes here
*/
}</role>
How Neo4j Works (cont.)
Dealing with complexity
• Simple domains can be complex
• Mutual Friend example
Case Study
• A side by side comparison of a
relational database and Neo4j
• Artificially generated graph
dataset with natural statistics
• 1 million vertices and 4
million edges
Case Study Results
• First 250 vertices used as roots
Result Conclusion
• Neo4j proved to take less than half the time of
the SQL database.
• Neo4j is optimal
Conclusion
•
•
•
•
•
Introduced Neo4j
Discussed NoSQL databases
Went over graph databases
How Neo4j works
Case study
Questions?
References
•
•
•
•
•
•
•
•
•
•
•
"Ayende @ Rahien." That No SQL Thing: Column (Family) Databases -. N.p., n.d. Web. 13 Mar. 2013.
<http://ayende.com/blog/4500/that-no-sql-thing-column-family-databases>.
WebsiteLinkTagsEditDelete
"Graph Database." Wikipedia. Wikimedia Foundation, 03 June 2013. Web. 13 Mar. 2013.
<http://en.wikipedia.org/wiki/Graph_database>.
WebsiteLinkTagsEditDelete
Krill, Paul. "Neo Technology Execs: How Neo4j Beat Oracle Database." InfoWorld. N.p., n.d. Web. 13
Mar. 2013. <http://www.infoworld.com/d/big-data/neo-technology-execs-how-neo4j-beat-oracledatabase-212106>.
WebsiteLinkTagsEditDelete
"MySQL vs. Neo4j on a Large-Scale Graph Traversal." Javalobby. N.p., 12 May 2011. Web. 13 Mar.
2013. <http://java.dzone.com/articles/mysql-vs-neo4j-large-scale>.
WebsiteLinkTagsEditDelete
"Neo4j Blog." : The Top 10 Ways to Get to Know Neo4j. N.p., n.d. Web. 13 Mar. 2013.
<http://blog.neo4j.org/2010/02/top-10-ways-to-get-to-know-neo4j.html>.
WebsiteLinkTagsEditDelete
"Processing MongoDB for and Open-Data Portal, MongoDB Emerges as NoSQL Leader." Magazine
for Software Developers Programmers and Designers Software Developers Journal. N.p., n.d. Web.
13 Mar. 2013. <http://sdjournal.org/mongodb-sdj-0512/>.
Applause