Over a million developers have joined DZone.

(Un)common Use Cases for Graph Databases

In the run up to GraphConnect Europe, I would like to illustrate that graphs are truly for everyone by going over some of the less obvious, though equally interesting and intellectually stimulating use cases that we have come across.

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database. Try it now! Brought to you in partnership with MongoDB.

At GraphAware, we live and breathe Neo4j. For three years, we have been helping customers around the world embrace this amazing technology as a solution to many interesting problems. Mainstream applications of graphs, such as real-time recommendationsfraud detection, impact analysis and graph-aided search have been getting a lot of media attention.

In the run up to GraphConnect Europe, we would like to illustrate that graphs are truly for everyone by going over some of the less obvious, though equally interesting and intellectually stimulating use cases that we have come across.

Rules Engines

Whether you’re a startup building a mobile application that will help people diagnose their medical condition, or a large retailer trying to decide which carrier to book a shipment with, you will need a computer program to interpret a set of potentially complex rules in order to determine an outcome, given a set of known initial conditions.

These rules will likely change too fast for the development teams to keep up, even in the most agile of environments. Moreover, it is typically the business, not the development teams, who define the rules. 

A data-driven, rather than code-centric approach, is needed, where rules can be loaded from a database and interpreted at runtime. To achieve this, we believe there is no better data model than a graph.

Learn about Less Common Use Cases for Graph Databases including Law Enforcement and Rules Engines



The image above shows a simple set of rules and point-based outcomes to help decide whether a person should attend GraphConnect in London. This graph can be understood by people with very little technical background, who would be able to tell just by looking at it that a person should attend the conference if they live in London or are a frequent traveller, but not if they are under the age of 18 or uninterested in technology.

For a developer, it would be equally easy to develop a simple application that interprets these rules and provides a decision for any given input. With this in place, business logic can be changed by adding, removing or updating rules directly in Neo4j.

With a working graph-based rules engine like this, a business user can decide in microseconds which shipping route to take based on the characteristics of a package or which supplier to use based on the requirements of a customer.

Intelligence and Law Enforcement

Let us now take a look at another important, yet not often publicised use for graphs. Criminals, terrorists and other “bad guys” have two things in common.

The first one is that they pose a greater threat when they are organised, i.e., they form some sort of a network. The second is that they leave traces of their activity, no matter how sophisticated they are.

Graph databases are a great tool for uncovering and investigating illegal or otherwise malicious activity for three main reasons. First, they are easy to query and navigate using the Cypher query language and available visualisation tools, even for non-developers. Second, they are very fast at analysing connected data. Hence, answers can be found very quickly in critical situations, such as during an ongoing terrorist attack. Finally, and perhaps most importantly, graphs help users discover the “unknown unknowns”.

Imagine you’re the investigator of a crime and all the clues you have are a credit card transaction and a car license plate. The first question you would most definitely want to answer first is whether these clues are in any way related and how. 

Without a graph database, you will have to start by enumerating all the ways these clues could be related. Even if you were able to do that, the resulting query would likely be very complicated.

In Neo4j, finding the answer could be as simple as this Cypher query:

MATCH p=(tx:Transaction {txId:'123abc'})-[*..10]-(c:Car {plate:'LOVE NE04J'})
RETURN p;

Without any up front knowledge about how the two may be related, you could find out, for example, that the card was used to pay for a speeding fine for the car and that it belongs to Alice, the sister of Bob who owns the vehicle.

A Graph Database in a Law Enforcement Use Case



See You at GraphConnect Europe

There are a plethora of other compelling use cases. We have used graphs to design complex university curricula, analyse investment portfolio risks, audit systems and even generate storylines that will appeal to an audience.

The possibilities of graphs are endless. Come meet us at GraphConnect to chat about how Neo4j can help you, no matter how niche your domain or particular problem. As always, the GraphAware conference stand will be a lot of fun! We look forward to meeting you soon. 

GraphAware is a Silver Sponsor of GraphConnect Europe. Click below to register for GraphConnect and meet Michal and the rest of the GraphAware team in London on 26 April 2016.

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.

Topics:
graph databases ,neo4j ,graphconnect

Published at DZone with permission of Andreas Kollegger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}