A graph database uses graph structure with nodes,
edges, and properties to represent and store data.
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.
Nodes represent Entities such as people, businesses,
accounts, or any other item you might want to keep
Properties are pertinent information that relate to
Edges are the lines that connect nodes to nodes or nodes to properties and
they represent the relationship between the two. Most of the important
information is really stored in the edges. Meaningful patterns emerge
when one examines the connections and interconnections of nodes,
properties, and edges.
Graph databases focus on
Compared with relational databases
Graph databases are often faster for associative data sets
map more directly to the structure of object-oriented applications
Scale more naturally to large data sets as they do not typically require expensive
As they depend less on a rigid schema, they are more suitable to manage ad-hoc
and changing data with evolving schemas.
What to find
How to find
// Find all the directors who have directed a movie scored by John Williams
// that starred Kevin Bacon
START actor=(actors, 'Kevin Bacon'), composer=(compsers, 'John Williams')
Modelling a Domain with Graphs
Graphs are "whiteboard-friendly"
Nouns become nodes
Verbs become relationships
Properties are adjectives and adverbs
Property Graph Model
Uses Lucene for indexing of graph/relationship properties
High performance on deep transversal
Property Graph Model
. Nodes have key / value properties
. Relationships between nodes
. Relationships have labels
. Relationships have key / value properties
. Relationships are directed but transversal at equals speed in both directions
. Semantics of the directions is up to the applications
Custom JTA/JTS compliant transaction manager
two-phase commit (2PC)
Supporting billions of nodes/relationships props on a single machine
.Can run embedded or Standalone via REST
. Plugins : Spatial data, Lucene, RDF, SOLR
. Runs on major platforms : Mac | Windows | Unix
. Extensive documentation
. Active community
. Open Source
Cypher is a declarative graph query language that allows
for expressive and efficient querying and updating of the
graph store without having to write traversals through the
graph structure in code
START: Starting points in the graph, obtained via index lookups or by element IDs.
MATCH: The graph pattern to match, bound to the starting points in START.
WHERE: Filtering criteria.
RETURN: What to return.
CREATE: Creates nodes and relationships.
DELETE: Removes nodes, relationships and properties.
SET: Set values to properties.
FOREACH: Performs updating actions once per element in a list.
WITH: Divides a query into multiple, distinct parts.
all simple paths,