Compare

Dgraph vs Neo4j

Which is the Best Graph Database?

Updated in May 2020

Dgraph Neo4j
Native GraphQL Support

Yes

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

No

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 writ
  • 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
Sharding
  • 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

Yes

  • 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 Cluster”. Reference
  • Casual Cluster is Enterprise Edition. Reference
Transparent Data Encryption

Yes

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
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
Backups
  • 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

Yes

  • 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

Yes

  • 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
Protocols
  • HTTP/HTTPS
  • gRPC
  • Protocol Buffers
  • BOLT
  • HTTP/HTTPS

Reference

Point in Time Recovery

On the roadmap

No
Multi-Region Deployments

Yes

Enterprise Edition supports multi-data center deployment

SQL Migration Tool

Yes

Authentication and Authorization
  • JSON web tokens
  • ACLs for enterprise
  • Integration with LDAP on the roadmap
  • In Enterprise Edition, these auth providers 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.
Drivers
  • 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
Reference
Multi-Database Features

Multi-tenancy supported since Dgraph v21.03

Graph Database as a Service (DBaaS)
Query Execution Plans
Query planning on the roadmap
Yes
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
Apache Spark Integration

No

Kafka Integration
On the roadmap
Import/ Export
  • 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)

Get Started Today!

Dgraph gives you the scalability and performance you need with the pricing and transparency you expect. Start building today with the world’s most advanced and performant GraphQL platform.