Saving and evaluating network paths in Neo4j

A Relationship Thing

Article from Issue 164/2014

The Neo4j graph database is much better suited than relational databases for storing and quickly querying nodes and their mutual relationships. If your circle of friends is not wide enough to warrant a graph-based application, you might just want to inventory your LAN.

Modeling structures like the social graph of Facebook, connections to friends and their acquaintances, or your follower structure on Twitter is surprisingly difficult with traditional databases. Trying to map a network path – easily represented with squiggles and arrows on a whiteboard – with a relational model inevitably leads to performance-hungry join statements, the natural enemy of responsive websites.

The Neo4j [1] graph database natively stores graph models and offers fantastic performance – as long as you don't overcook the complexity of the queries. Its generic storage model consists of nodes and relationships. Both can possess attributes; for example, a node that represents a person could contain a name field for storing the name or carry a relationship is_friends_with and its intensity (best_friend, casual_friend).

Cypher Query Language

The Neo4j query processor takes inquiries in the SQL-style Cypher language, rummages through the data located in the database, and quickly returns results that Cypher also filters and processes in SQL style (i.e., sort, group, etc.).


Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Kaspersky Polishes Mail Gateway

    Russian security specialist Kaspersky has reworked its anti-spam product for Linux and Unix servers.

  • Perl: isp-switch

    When an Internet provider goes down, users suffer. Alternatively, users can immediately switch to another ISP. We’ll show you a Perl script that can help you reconfigure your computer to make the switch.

  • Charly's Column – Munin

    What do you do if the Munin system monitoring tool does not have a native Munin client for a device? Sys admin Charly has a solution.

  • Freenet

    The Free Network Project provides a safe environment for free speech – even for users who fear censorship.

  • MongoDB NoSQL Database

    MongoDB combines the usual advantages of NoSQL databases with sharding, load balancing, replication, and failover.

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95