Graph Database & Neo4j
Created By: Sandip Jadhav
Puzzle
Traces through all the edges of a graph without lifting one’s pencil
and without retracing any edge more than once
1. 2. 3.
4. 5. 6.
© 2013 TomTom. All rights reserved. Confidential information.2
Euler path
• An Euler path is a path that uses every edge of a
graph exactly once.
• Seven Bridges of Königsberg is a historically
notable problem in mathematics
• Theorem: An Eulerian trail exists in a connected
graph if and only if there are either no odd vertices
or two odd vertices.
© 2013 TomTom. All rights reserved. Confidential information.3
NOSQL
© 2013 TomTom. All rights reserved. Confidential information.4
Four NOSQL Categories
• Key-value stores
• Based On Amazon’s Dynamo Paper
• Data model : (global) collection of K-V pairs
• Example : Riak, Voldemort, Redis
• Column-Family
• Based on Google’s BigTable paper
• Data Model: big table, column families
• Example : Hbase, Hypertable, Cassandra
© 2013 TomTom. All rights reserved. Confidential information.5
Four NOSQL Categories
• Document Databases
• Inspired by Lotus Notes
• Data model : collection of K-V Collection
• Example : CouchDB, MongoDB
• Graph Databases
• Inspired by Euler & graph theory
• Data Model: nodes, relationship
• Example : AllegroGraph,Sones,Neo4j
© 2013 TomTom. All rights reserved. Confidential information.6
© 2013 TomTom. All rights reserved. Confidential information.7
Path Puzzles
© 2013 TomTom. All rights reserved. Confidential information.8
Mumbai Local Map
Graph to represent simple map
© 2013 TomTom. All rights reserved. Confidential information.9
Early Adopters of Graph Tech
Facebook Social Graph
© 2013 TomTom. All rights reserved. Confidential information.10
Early Adopters of Graph Tech
Google internet graph ( Page Rank ) & Knowledge Graph
© 2013 TomTom. All rights reserved. Confidential information.11
Google Knowledge Graph
© 2013 TomTom. All rights reserved. Confidential information.12
Graph Database
& Neo4j Intro
© 2013 TomTom. All rights reserved. Confidential information.13
Graph are Whiteboard friendly
© 2013 TomTom. All rights reserved. Confidential information.14
Top Reasons choose Graph database
15
• Problems with Join performance.
• Continuously evolving data set (often
involves wide and sparse tables)
• The Shape of Domain is naturally a
graph
• Open-ended business requirements
necessitating fast, iterative
development.
© 2013 TomTom. All rights reserved. Confidential information.
Graph Databases are Designed to:
• Highly connected data (social networks)
• Make sense of that data
• Recommendations (e-commerce)
• Path Finding (how do I know you?)
• A* (Least Cost path)
Data First Schema (bottom-up, but you still need to
design)
© 2013 TomTom. All rights reserved. Confidential information.16
Emerging Domains to use Graph DB
17 © 2013 TomTom. All rights reserved. Confidential information.
Neo4j
© 2013 TomTom. All rights reserved. Confidential information.18
Graph Db (Neo4j) Performance
© 2013 TomTom. All rights reserved. Confidential information.19
The Neo4J Secrete Sauce
© 2013 TomTom. All rights reserved. Confidential information.20
Neo4j Example : Matrix Movie
21 © 2013 TomTom. All rights reserved. Confidential information.
Create node & relationship
© 2013 TomTom. All rights reserved. Confidential information.22
Transaction
© 2013 TomTom. All rights reserved. Confidential information.23
Define Relationship
© 2013 TomTom. All rights reserved. Confidential information.24
Travels Graph
© 2013 TomTom. All rights reserved. Confidential information.25
Result of Travelasal
© 2013 TomTom. All rights reserved. Confidential information.26
Neo4J Logical architecture
© 2013 TomTom. All rights reserved. Confidential information.27
Query language : Cypher
© 2013 TomTom. All rights reserved. Confidential information.28
Query language : Cypher
© 2013 TomTom. All rights reserved. Confidential information.29
Query language : Gremlin
© 2013 TomTom. All rights reserved. Confidential information.30
• Graph travels language
• DSL (Groovy based)
http://console.neo4j.org/
© 2013 TomTom. All rights reserved. Confidential information.31
References
• http://martinfowler.com/bliki/PolyglotPersistence.html
• http://neo4j.com
© 2013 TomTom. All rights reserved. Confidential information.32
Thank you
Any questions?

Graph database & neo4j

  • 1.
    Graph Database &Neo4j Created By: Sandip Jadhav
  • 2.
    Puzzle Traces through allthe edges of a graph without lifting one’s pencil and without retracing any edge more than once 1. 2. 3. 4. 5. 6. © 2013 TomTom. All rights reserved. Confidential information.2
  • 3.
    Euler path • AnEuler path is a path that uses every edge of a graph exactly once. • Seven Bridges of Königsberg is a historically notable problem in mathematics • Theorem: An Eulerian trail exists in a connected graph if and only if there are either no odd vertices or two odd vertices. © 2013 TomTom. All rights reserved. Confidential information.3
  • 4.
    NOSQL © 2013 TomTom.All rights reserved. Confidential information.4
  • 5.
    Four NOSQL Categories •Key-value stores • Based On Amazon’s Dynamo Paper • Data model : (global) collection of K-V pairs • Example : Riak, Voldemort, Redis • Column-Family • Based on Google’s BigTable paper • Data Model: big table, column families • Example : Hbase, Hypertable, Cassandra © 2013 TomTom. All rights reserved. Confidential information.5
  • 6.
    Four NOSQL Categories •Document Databases • Inspired by Lotus Notes • Data model : collection of K-V Collection • Example : CouchDB, MongoDB • Graph Databases • Inspired by Euler & graph theory • Data Model: nodes, relationship • Example : AllegroGraph,Sones,Neo4j © 2013 TomTom. All rights reserved. Confidential information.6
  • 7.
    © 2013 TomTom.All rights reserved. Confidential information.7
  • 8.
    Path Puzzles © 2013TomTom. All rights reserved. Confidential information.8
  • 9.
    Mumbai Local Map Graphto represent simple map © 2013 TomTom. All rights reserved. Confidential information.9
  • 10.
    Early Adopters ofGraph Tech Facebook Social Graph © 2013 TomTom. All rights reserved. Confidential information.10
  • 11.
    Early Adopters ofGraph Tech Google internet graph ( Page Rank ) & Knowledge Graph © 2013 TomTom. All rights reserved. Confidential information.11 Google Knowledge Graph
  • 12.
    © 2013 TomTom.All rights reserved. Confidential information.12 Graph Database & Neo4j Intro
  • 13.
    © 2013 TomTom.All rights reserved. Confidential information.13
  • 14.
    Graph are Whiteboardfriendly © 2013 TomTom. All rights reserved. Confidential information.14
  • 15.
    Top Reasons chooseGraph database 15 • Problems with Join performance. • Continuously evolving data set (often involves wide and sparse tables) • The Shape of Domain is naturally a graph • Open-ended business requirements necessitating fast, iterative development. © 2013 TomTom. All rights reserved. Confidential information.
  • 16.
    Graph Databases areDesigned to: • Highly connected data (social networks) • Make sense of that data • Recommendations (e-commerce) • Path Finding (how do I know you?) • A* (Least Cost path) Data First Schema (bottom-up, but you still need to design) © 2013 TomTom. All rights reserved. Confidential information.16
  • 17.
    Emerging Domains touse Graph DB 17 © 2013 TomTom. All rights reserved. Confidential information.
  • 18.
    Neo4j © 2013 TomTom.All rights reserved. Confidential information.18
  • 19.
    Graph Db (Neo4j)Performance © 2013 TomTom. All rights reserved. Confidential information.19
  • 20.
    The Neo4J SecreteSauce © 2013 TomTom. All rights reserved. Confidential information.20
  • 21.
    Neo4j Example :Matrix Movie 21 © 2013 TomTom. All rights reserved. Confidential information.
  • 22.
    Create node &relationship © 2013 TomTom. All rights reserved. Confidential information.22
  • 23.
    Transaction © 2013 TomTom.All rights reserved. Confidential information.23
  • 24.
    Define Relationship © 2013TomTom. All rights reserved. Confidential information.24
  • 25.
    Travels Graph © 2013TomTom. All rights reserved. Confidential information.25
  • 26.
    Result of Travelasal ©2013 TomTom. All rights reserved. Confidential information.26
  • 27.
    Neo4J Logical architecture ©2013 TomTom. All rights reserved. Confidential information.27
  • 28.
    Query language :Cypher © 2013 TomTom. All rights reserved. Confidential information.28
  • 29.
    Query language :Cypher © 2013 TomTom. All rights reserved. Confidential information.29
  • 30.
    Query language :Gremlin © 2013 TomTom. All rights reserved. Confidential information.30 • Graph travels language • DSL (Groovy based)
  • 31.
    http://console.neo4j.org/ © 2013 TomTom.All rights reserved. Confidential information.31
  • 32.
    References • http://martinfowler.com/bliki/PolyglotPersistence.html • http://neo4j.com ©2013 TomTom. All rights reserved. Confidential information.32
  • 33.

Editor's Notes

  • #6 Data Model ColumnFamily:  ColumnFamily is a single structure that can group Columns and SuperColumns with ease. Key: the permanent name of the record. Keys have different numbers of columns, so the database can scale in an irregular way. Keyspace:  This defines the outermost level of an organization, typically the name of the application. For example, ‘3PillarDataBase’ (database name). Column:  It has an ordered list of elements aka tuple with a name and a value defined. In comparison, most relational DBMS store data in rows, the benefit of storing data in columns, is fast search/ access and data aggregation
  • #8  polyglot persistence will come at a cost - but it will come because the benefits are worth it.
  • #19 A Graph Database + Lucene Index Property Graph Full ACID (atomicity, consistency, isolation, durability) High Availability (with Enterprise Edition) 32 Billion Nodes, 32 Billion Relationships, 64 Billion Properties Embedded Server REST API