Faceoff: Relational vs. Graph

Graph database vendors spend a lot of energy explaining how much faster graph technology is for running queries on connected data. But how much faster is it?

The more connected your data is, and the more complex your query is, the faster graph technology is at processing your requests. The reason is that connected-data queries are based on relationships, which form natural paths through your data. Relational databases convert these natural paths into unwieldy rows and columns of data, while graph databases preserve the data’s natural, path-oriented organization.
When you query connected data in a Neo4j graph database, it traverses the paths through the data naturally and efficiently—because it follows the native organization of the data. The performance benefits of storing and accessing connected data with native graph technology is quite compelling.

Putting Graph and Relational to the Test

In their book Neo4j in Action, Partner and Vukotic summarize the details of a multi-level query benchmark they ran against a relational store and a Neo4j graph database. The query retrieved friends-of-friends in a social network to a depth of five levels.

For a network of a million people, each with approximately 50 friends, the results show that Neo4j is a far superior database platform over relational for connected data.

Graph is Hundreds to Thousands of Times Faster than Relational

The above table shows how lackluster relational performance cripples applications that rely on connected datasets and multi-level queries.

At two query levels deep, the relational system begins falling behind, and at three levels and beyond, its query speed is unacceptable, rising to a point where Neo4j runs more than a thousand times faster than the relational database. At five levels deep, the relational system does not even finish running the query and would apparently hang a real-world system.

In contrast, Neo4j’s response time remains relatively flat for even the deepest queries: just a fraction of a second to perform the requests, and well within the responsiveness requirements for an online system.

Which Applications Benefit Most from Graph Technology?

The Neo4j graph database platform can be used for a wide variety of business applications, but there are many for which native graph technology is absolutely required to meet performance and reliability requirements. Some samples of those applications appear below.

Retail and E-Commerce

  • Purchase history recommendations
  • Peer recommendations

Social and Business Networks

  • Friendship and relationship sites
  • Professional networks and organizations
  • Event recommendation and review sites
  • Membership and organization management

Information Management

  • Identity and access management
  • Master data management
  • Network operations
  • Internet of Things and sensor monitoring
  • Support case solution

Customer and Sales Management

  • Prospect identification
  • Product recommendation

Finance

  • Identity and access management
  • Fraud detection
  • Product and service recommendations

Healthcare

  • Care provider recommendations
  • Clinical data analysis and bioinformatics
  • Insurance fraud

Logistics

  • Real-time routing
  • Supply-chain management and risk assessment