Skip to content

Graph DB

illyfrancis edited this page Aug 1, 2013 · 3 revisions

Why choose a graph db?

  • You need to access data through multi-step traversals (find data in a network or hierarchy)
  • You need flexibility on how to access the data in the future (a graph database is easier to change than other models)

concepts?

  • Weighted relationships
  • Can have bidirectional relationships
  • Relationship pointing to itself (for modelling hierarchy?)

Graph Modeling Principles

  1. Embrace the paradigm
    • Use the building blocks
      • Node, relationship, property
    • Anti-pattern
      • Rich properties -> instead normalize nodes
  2. Nodes for Identity (37:00)
    • break out separate concepts
    • Property represents entity (I'm guessing it means turn the property into node(s))
      • (Reify | Nodify) connecting entities
      • simulating hyper-graph (relationship can have relationship) as Neo4j doesn't support it
  3. Relationship for Access
    • Relationships for querying
      • Relationships should the primary means to access nodes in the database
      • Traversing relationships is cheap - that's the whole design goal of a graph database
      • Use indexes only to find starting node a query

Clone this wiki locally