logo
Contact Enterprise Sales

Success-stories

Graph Database Performance Comparison: Neo4j vs NebulaGraph vs JanusGraph

Performance Comparison: Neo4j vs NebulaGraph vs JanusGraph

Who Did the Graph Database Comparison

This article describes how the Tencent Cloud team compares NebulaGraph with two other popular graph databases on the market from several perspectives.

By their nature of dealing with interconnections, graph databases are perfect for fraud detection and building knowledge graphs in the security field. To better serve the Tencent Cloud business scenarios, the Tencent Cloud Security team has to select a highly performant graph database which fits the business development well, which is how this performance comparison comes into play.

Whom to Compare With

Neo4j

Neo4j is the most widely adopted graph database in the industrial world. It has a Community edition and an Enterprise edition. For comparison in this article, the team has chosen the Community edition.

HugeGraph (A fork of JanusGraph)

HugeGraph is a distributed graph database developed by Baidu. It is forked from JanusGraph. HugeGraph is developed to address the needs of anti-fraud, threat intelligence collection, and underground economy attack with graph storage and analysis capabilities. It has pretty good read and write performance.

NebulaGraph

NebulaGraph is an open source distributed graph database developed by vesoft Inc. It features the capability of dealing with super large datasets with hundreds of billions of vertices and trillions of edges.

Hardware Environments

Item Specs
CPU Intel Xeon(R) Gold 6133 CPU @ 2.5GHz X86_64
# of Physical CPUs 2
# of Physical Cores 20
# of Logical CPUs 80
Memory 260 GB

Graph Database Performance Comparison Test Results

The Tencent Cloud Security team has used graph data at different orders of magnitudes for testing purpose. The test has been performed against various metrics, including data import efficiency, one-hop query, two-hop query, and shared friends query.

The results are as below:

Graph Data Size Platform Data Import One-Hop Query Two-Hop Query Shared Friends Query
10 Million Edges Neo4j 26s 6.618s 6.644s 6.661s
HugeGraph 89s 16ms 22ms 72ms
NebulaGraph 32.63s 1.482ms 3.095ms 0.994ms
100 Million Edges Neo4j 1min21s 42.921s 43.332s 44.072s
HugeGraph 10min 19ms 20ms 5s
NebulaGraph 3min52s 1.971ms 4.34ms 4.147ms
1 Billion Edges Neo4j 8min34s 165.397s 176.272s 168.256s
HugeGraph 65min 19ms 651ms 3.8s
NebulaGraph 29min35s 2.035ms 22.48ms 1.761ms
8 Billion Edges Neo4j 1h23min 314.34s 393.18s 608.27s
HugeGraph 16h 68ms 24s 541ms
NebulaGraph ~30min Less than 1s Less than 5s Less than 1s

Seen from the above table, in terms of data import, NebulaGraph is a bit slower than Neo4j when the data size is small. However, when the data size is large, NebulaGraph is much faster than the other two. For the three graph queries, NebulaGraph shows clearly better performance compared to Neo4j and HugeGraph.

Here is a chart overview of the comparison:

Graph Database Performance Comparison Chart

Graph Query Language Comparison

Neo4j Cypher

One-Hop Friends Query

match ({vid:11111}) -> (u)
return u;

Two-Hop Friends Query

match ({vid:11111}) -> () -> u
return u;

Shared Friends Query

match ({vid:11111}) -> (u) <- ({vid:22222})
return u;

NebulaGraph nGQL

One-Hop Friends Query

GO FROM 11111 OVER relation

Two-Hop Friends Query

GO 2 STEPS FROM 11111 OVER relation

Shared Friends Query

GO FROM 11111 OVER relation INTERSECT
GO FROM 22222 OVER relation

How NebulaGraph Works

  1. NebulaGraph Architecture — A Bird’s Eye View
  2. Benchmark: NebulaGraph vs Dgraph vs JanusGraph
  3. Deploy the Graph Database on Kubernetes

docker