Getting started with Dgraph Cloud workshop on 5/20 - Free signup

Dgraph vs Neo4j

Which is the Best Graph Database?

Updated in May 2020



Native GraphQL Support


Only DB to natively support GraphQL resulting in capacity to process GraphQL queries in parallel with high performance


Neo4j uses an annotated GraphQL Schema to translate any GraphQL query to a single Cypher query that is executed against Neo4j. Reference

Distributed Graph Database

Distributed with the ability to use the same query everywhere as if querying a single database Data consistency is not guaranteed in a distributed Neo4j database. Even with 4.0, this is a work in progress Reference

Distributed ACID Transactions

  • Supported and Jepsen-tested
  • Synchronous replication with immediate consistency meaning any client can read the latest write
  • Open source
  • Reference
  • Transactions have causal consistency which means “client application is guaranteed to read at least its own writes”
  • Distributed transactions are very new in Neo4j
  • Only available to enterprise users
  • Reference


  • Predicate-based sharding. Avoids N+1 problem and network broadcasts when running a query in high fanout scenarios. This ensures low-latency query execution, irrespective of the size of the cluster or the number of intermediate results. Reference
  • Consistent production level latencies and consistent queries Reference
  • Automatic sharding
  • Sharding a single predicate on the roadmap
  • Graph sharding is done by “allowing users to break a larger graph down into individual, smaller graphs and storing them in separate databases. For graphs that are highly-connected, this means some level of data redundancy to maintain the relationships between entities…” Reference
  • When sharding is used, users have to change their queries/mutations to work with clustering Reference

Consistent Replication

Synchronous replication across all replicas Core servers have consistent replication, however “Read Replicas are asynchronously replicated from core servers” Reference

Linearizable Reads

Strong (sequential) consistency across clients Reference Causal and eventual consistency configurable in Causal Cluster setup. Immediate consistency in stand-alone mode Reference

Correctness and Durability Testing

Transactional consistency in not Jepsen tested

High Availability


  • HA Cluster Setup is explained here
  • HA Cluster setup is available in Community Edition


  • No. “Although customers could use the HA functionality in the latest 3.5.x release, going forward, there will be no new feature release offering for the HA component as all development efforts are targeted for Causal ClusterReference
  • Casual Cluster is Enterprise Edition Reference

Transparent Data Encryption


Yes, database files are encrypted at rest with a user-specified key
  • Integration between Neo4j Enterprise Edition and Thales offers data-at-rest encryption Reference
  • Neo4j doesn’t support Transparent Data Encryption. They recommend using a volume-level encryption (outside the database) Reference

Query Languages

Cypher Query Language

Management of Runaway Queries

  • Context cancellation which works across clients and servers. So, a context cancellation at the client level would automatically cancel the query at all involved servers
  • OpenCensus integration, which allows distributed tracing all the way from app to Dgraph cluster and back
  • Open standards for query context cancellation and tracking


  • Binary format
  • Both full and incremental backups to files, S3 and Google storage via Minio
  • Live backups with no downtime
  • Reference
  • Can do both offline and online backups
  • In a cluster, “both Read Replicas and Cores can fall behind the leader and be out-of-date”. Applications need to write logic to keep track of transaction ids in order to avoid taking a backup from a server that has lagged too far behind
  • Reference

Pricing and Free Trial

  • Open source version is under Apache 2.0, so free to use and modify
  • Enterprise version pricing is based on the number of instances of Dgraph, not the number of cores / RAM / Disk, etc…
  • Community Edition is free under GPL v3 license
  • Enterprise Edition pricing is not published on Neo4j site (30 day free trail)
  • Neo4j Community Edition does not have horizontal scalability and distributed transactions
  • Neo4j Desktop is free with registration, and it includes a free development license for Enterprise Edition
  • Reference

Appropriate as primary database to
build apps/data platform on

Dgraph is a general-purpose database Typically used as a secondary database for specific use cases

Open Source


  • Apache 2.0. GitHub
  • Enterprise features are NOT Apache 2.0. But, users can still read the source
  • Dgraph open source version and enterprise version provide the same performance. They’re only different in that enterprise version has more features
  • Dgraph supports many open standards, like Grpc, Protocol Buffers, Go contexts, Open Census integration for distributed tracing


  • GPL v3 license. GitHub
  • Many of the distributed features of Neo4j are closed source / enterprise license and not verified by third-parties, like Jepsen
  • Reference


  • gRPC
  • Protocol Buffers

Point in Time Recovery

On the roadmap No

Multi-region Deployments

Yes Enterprise Edition supports multi-data

SQL Migration Tool

Yes Data migration between MySQL and Neo4

Authentication and authorization

  • JSON web tokens
  • ACLs for enterprise
  • Integration with LDAP on the roadmap
  • In Enterprise Edition, these auth provider can perform user authentication and authorization: Native auth provider, LDAP auth providers, custom-built plugin auth providers, Kerberos authentication and single sign-on
  • In Community Edition, a limited set of user management functions are available. Here is a quick overview of these


  • Dgraph’s drivers use gRPC not REST
  • Any GraphQL compatible client can be used
  • Dgraph’s supported drivers are the same as Neo4J’s supported drivers: Java, JavaScript , Go, Python, .Net
  • Dgraph’s unofficial drivers are: Rust, Dart, Elixir
  • Reference
  • Supported drivers: Java, JavaScript, Go, Python, .Net
  • Unofficial drivers: Spring, Ruby, Neo4j-OGM, R, PHP, Haskell, Perl, Clojure, C/C++, Erlang/Elixir
  • Reference

Multi-database Features

Multi-Tenancy on the roadmap Multi-Tenancy in Neo4j

Graph Database As A Service (DBaaS)


Query Execution Plans

Query planning on the roadmap


Users can use the PROFILE command with their cypher query directly in Neo4j browser to see a visualization of the execution plan

Support for graph algorithms

  • Shortest k-paths
  • Edge traversal limit to determine cycles in graphs
  • Others requested from community listed here
Neo4j Graph Data Science (GDS) Library

Apache Spark integration


Neo4j Spark Connector

Kafka integration

On the roadmap Neo4j Streams Kafka Integration


  • Using BulkLoader or LiveLoader, Dgraph can read the data as is with no modification needed
  • Supported data formats are JSON and RDF
  • Exporting database is explained here
  • Export: (CSV, JSON, Cypher Script, GraphML, Gehphi)
  • Import: (JSON, CSV, XLS, XML, HTML, GRPHML, from web APIs)

Looking for a Neo4j alternative?

Free to Zoom?