Database Reference
In-Depth Information
storedataasagraph,withastructureconsistingof vertices and edges ,thetwoentitiesused
to model any graph.
In addition, you can use all the algorithms from the long history of graph theory to solve
graph problems more efficiently and in less time than using relational database queries.
Onceyou'vereadthisbook,you'llbefamiliarwithNeo4j,oneofthemostprominentgraph
databases available. You'll learn how a Neo4j graph database helps you model and solve
graph problems in a better-performing and more elegant way, even when working with
large data sets.
1.1. Why Neo4j?
Why would you use a graph database, or more specifically Neo4j, as your database of
choice? As mentioned earlier, it's often quite natural for people to logically try to model,
ordescribe,theirparticular problemdomainusinggraph-likestructuresandconcepts,even
though they may not use a graph database as their ultimate data store. Choosing the right
data store (or data stores—plural, in today's polyglot persistence world) to house your data
can make your application soar like an eagle; it can come crashing to the ground just as
easily if the wrong choice is made.
A good way to answer this question, then, is to take a problem that naturally fits very well
into the graph-based world and compare how a solution using Neo4j fares against one us-
ing a different data store. For comparison purposes, we'll use a traditional relational data-
base, as this is generally the lowest common denominator for most people when it comes
tounderstandingdatastorageoptions.Moreimportantly,it'swhatmostpeoplehaveturned
to—and sometimes still turn to—to model such problems.
The example we're going to explore is a social network—a set of users who can be friends
with each other. Figure 1.1 illustrates the social network, where users connected with ar-
rows are friends.
Search WWH ::




Custom Search