104 | Big Data Simplied
5.3.4
Graph Databases
The last of the four subcategories we need to look at are graph databases. They really focus on the
relationships between entities, rather than especially being focused on the representation of the
entities themselves. Graph databases tend to be extremely useful for social media applications,
for example, to track relationships between people in social networks.
Look at the example in Figure 5.5, where we start with a database. We have a number of nodes
and there is a node for John Smith. We have another node which has four different properties in
it, they are House No, Street Name, City, State and Zip. In between those two nodes we have an
edge. The edge is given a relationship name of Address. This is a kind of edge that represents a
property. So, John Smith has an address, and that address in turn has four properties and values
of its own. But John Smith can also have a simple relationship to another node in the database
that represents another person. In this case, John Smith is a friend of John Doe. John Smith has
also sent an invitation to Jane Doe in his social network. And John Doe has commented on a
photo by Jane Smith in a social network. So, what you can see here is that, we have heteroge-
neous types of data and we can relate them through the edges. We can also have a hierarchical
relationship here. In this case, John Smith placed an order and that order has its own properties
and values as well. As you can see, this type of database is highly appropriate for social media
applications.
Some examples of graph databases are Neo4j and GraphDB.
Figure 5.5 Graph database
Database
House No: 123
Street: Park Street
City: New York
State: NY
Zip Code: 10014
Jane Smith
John Doe
John Smith
Jane Doe
Order ID: 1701
Total Price: 1000
USD
Item ID: 2345
Type: Dress
Colour: Red
Item ID: 7890
Type: Shirt
Colour: Blue
Address
Friend
Commented
on a photo
Sent a friend
request
Placed an
online order
Order
contains
Order
contains
M05 Big Data Simplified XXXX 01.indd 104 5/20/2019 7:42:45 PM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.136.17.139