Database Reference
In-Depth Information
Complex, join-intensive queries
We discussed in the previous chapter how relational database management
systems suffer from signiicantdrawbacks,astheyhavetodealwithmoreand
more complex data models. Asking these kinds of questions of a relational database
requires the database engine to calculate the Cartesian product of the full indices
on the tables involved in the query. That computation can take a very long time
on larger datasets, or if more than two tables are involved.
Graph database management systems do not suffer from these problems. The join
operations are effectively precalculated and explicitly persisted in the database based
on the relationships that connect nodes together. Therefore, joining data becomes as
simple as hopping from one node to another—effectively as simple as following a
pointer.Thesecomplexquestionsthataresodificulttoaskinarelationalworld
areextremelysimple,eficient,andfastinagraphstructure.
Path inding queries
ManyusersofNeo4jusethegraphstructureoftheirdatatoindoutwhetherthereare
useful paths between different nodes on the network. Useful in this phrase is probably
theoperativeword;theyarelookingforspeciicpathson the network to:
• See whether the path actually exists. Are there any connections between
twodataelements,andifsowhatdoesthatconnectivitylooklike?
• Look for the optimal path. Which path between two things has the
lowest"cost?"
• Look for the variability of the path if a certain component of the path
changes. What happens to the path if the properties of a node or
relationshipchange?
Both of these sweet spot use cases share a couple of important characteristics:
• Theyare"graphlocal"andtheyhaveoneormoreixedstarting
point(s), or "anchor", in the graph from where the graph database
engine can start traversing out
• They are performed "in the clickstream", and therefore performed on
near-real-time data
Let's now switch to another key element of Neo4j's success as a graph database
management system: the fact that it is an open source solution.
 
Search WWH ::




Custom Search