Graph Store Model in Neo4j

Neo4j

Neo4j is an open-source, NoSQL, native graph database that provides an ACID-compliant transactional backend for your applications that has been publicly available since 2007. This article only focus on graph store model of Neo4j.

Property Graph

In property graph, information is organized as nodes, relationships, and properties.[2]

Graph Store Model in Neo4j_第1张图片

Nodes are the entities in the graph.

  • Nodes can be tagged with labels, representing their different roles in your domain. (For example, Person).
  • Nodes can hold any number of key-value pairs, or properties. (For example, name)
  • Node labels may also attach metadata (such as index or constraint information) to certain nodes.

Relationships provide directed, named, connections between two node entities (e.g. Person LOVES Person).

  • Relationships always have a direction, a type, a start node, and an end node, and they can have properties, just like nodes.
  • Nodes can have any number or type of relationships without sacrificing performance.
  • Although relationships are always directed, they can be navigated efficiently in any direction.

Graph Store Model

The following figure[3] details a simple example of an property graph in Neo4j. Here three vertices v 1 v_{1} v1, v 2 v_{2} v2, v 3 v_{3} v3 are connected via different edges e 1 e_{1} e1, e 2 e_{2} e2, . . . e 5 e_{5} e5. The edges have labels l 1 l_{1} l1, l 2 l_{2} l2 which represents different relationships between the connected vertices.

Graph Store Model in Neo4j_第2张图片

In this model, each vertex record contains a pointer to the first edge and additional metadata such as a pointer to vertex properties. Each edge record contains the label representing the relationship between the connected vertices, pointers to the vertex pairs connected by the edge, and the pointers for previous and next edges for each vertex. The vertex and edge records for the graph at Figure 1 are shown in Table I.

Graph Store Model in Neo4j_第3张图片

reference

  • [1] Neo4j
  • [2] Neo4j developer
  • [3] Computation-in-Memory Accelerators for Secure Graph Database: Opportunities and Challenges

你可能感兴趣的:(neo4j)