Databases Reference
In-Depth Information
Graph representations are no different in this respect. What perhaps differentiates them
from many other data modeling techniques, however, is the close affinity between the
logical and physical models. Relational data management techniques require us to de‐
viate from our natural language representation of the domain: first by cajoling our rep‐
resentation into a logical model, and then by forcing it into a physical model. These
transformations introduce semantic dissonance between our conceptualization of the
world and the database's instantiation of that model. With graph databases, this gap
shrinks considerably.
We Already Communicate in Graphs
Graph modeling naturally fits with the way we tend to abstract the salient details from
a domain using circles and boxes, and then describe the connections between these
things by joining them with arrows. Today's graph databases, more than any other da‐
tabase technologies, are “whiteboard friendly.” The typical whiteboard view of a problem
is a graph. What we sketch in our creative and analytical modes maps closely to the data
model we implement inside the database. In terms of expressivity, graph databases re‐
duce the impedance mismatch between analysis and implementation that has plagued
relational database implementations for many years. What is particularly interesting
about such graph models is the fact that they not only communicate how we think things
are related, but they also clearly communicate the kinds of questions we want to ask of
our domain. As we'll see throughout this chapter, graph models and graph queries are
really just two sides of the same coin.
The Property Graph Model
We introduced the property graph model in Chapter 1 . To recap, these are its salient
features:
• A property graph is made up of nodes , relationships , and properties .
• Nodes contain properties. Think of nodes as documents that store properties in the
form of arbitrary key-value pairs. The keys are strings and the values are arbitrary
data types.
• Relationships connect and structure nodes. A relationship always has a direction,
a label, and a start node and an end node —there are no dangling relationships.
Together, a relationship's direction and label add semantic clarity to the structuring
of nodes.
• Like nodes, relationships can also have properties. The ability to add properties to
relationships is particularly useful for providing additional metadata for graph
 
Search WWH ::




Custom Search