vs

Dgraph vs SurrealDB

Dgraph: Distributed, horizontally scalable graph database in Go with native GraphQL and DQL. SurrealDB: Rust multi-model database (documents, graph, vectors, live queries) that runs embedded, in WASM or clustered.

key differences

  • Dgraph is primarily a graph database; SurrealDB is document.
  • Licensing: Dgraph is open source (permissive) (Apache License 2.0); SurrealDB is source-available (Business Source License 1.1 (converts to Apache 2.0 after 4 years)).
  • Dgraph is built for larger datasets (≤ 1 PB) than SurrealDB (≤ 10 TB).
  • Horizontal scaling is native in Dgraph and addon in SurrealDB.
  • Only Dgraph has compression, encryption at rest.
  • Only SurrealDB has joins, triggers, stored procedures, materialized views, pub/sub.
  • SurrealDB can run embedded in your application process.

choose dgraph for

  • +GraphQL application backends
  • +Knowledge graphs and content relationships
  • +Real-time recommendations
  • +Metadata and lineage graphs

best at · OLTP, Traversal, Knowledge graph

choose surrealdb for

  • +Greenfield apps wanting one backend for documents and relationships
  • +Agent memory and knowledge graphs for AI applications
  • +Local-first or in-browser data with WASM
  • +Realtime collaborative features

best at · OLTP, Traversal, Vector search

overview
Primary model
Graph
Document
Also supports
Vector
Graph, Key-Value, Vector, Search Engine, Time-Series, Spatial
Type
Database engine
Database engine
Status
Active
Active
Developer
Istari Digital
SurrealDB Ltd
First release
2016
2022
Latest version
25.5.1 (Oct 22, 2026)
3.3.4 (Oct 19, 2026)
License
Open source (permissive)Apache License 2.0
Source-availableBusiness Source License 1.1 (converts to Apache 2.0 after 4 years)
Free tier
✓
✓
popularity
WhichDB Score
22.4
28.8
Rank
#137
#94
GitHub stars
21.8K
33.2K
Stack Overflow questions
108
111
scale & guarantees
Comfortable data size
Large (≤ 1 PB)
Medium (≤ 10 TB)
Horizontal scaling
Native
Addon
Multi-region
None
None
ACID
Full
Full
Consistency
Strong
Strong
Schema
Flexible
Flexible
Architecture
Distributed, Client server
Single node, Embedded, Distributed, Client server, In memory
deployment
Self-hosted
✓
✓
Vendor-managed cloud
—
✓
Serverless
—
—
Embedded
—
✓
Edge
—
✓
Clouds
–
AWS, Google Cloud, Azure
capabilities
Transactions
✓
✓
Joins
—
✓
Secondary indexes
✓
✓
Full-text search
✓
✓
Vector search
✓
✓
Geospatial
✓
✓
JSON
✓
✓
Change data capture
✓
✓
Triggers
—
✓
Stored procedures
—
✓
Materialized views
—
✓
TTL / expiry
—
—
Pub/Sub
—
✓
Columnar storage
—
—
In-memory
—
✓
Durable persistence
✓
✓
Compression
✓
—
Encryption at rest
✓
—
Role-based access
✓
✓
Time travel
—
—
Branching
—
—
Online schema changes
✓
✓
Streaming ingest
—
—
Offline sync
—
—
Runs in WebAssembly
—
✓
interfaces
Query languages
DQL, GraphQL
SurrealQL, GraphQL
Client languages
Go, Java, JavaScript, Python, C#
Rust, JavaScript, Python, Go, Java, C#, PHP
Best for
OLTP, Traversal, Knowledge graph, Vector search
OLTP, Traversal, Vector search, RAG

Dgraph vs SurrealDB: FAQ

What is the difference between Dgraph and SurrealDB?

Dgraph: Distributed, horizontally scalable graph database in Go with native GraphQL and DQL. SurrealDB: Rust multi-model database (documents, graph, vectors, live queries) that runs embedded, in WASM or clustered. Dgraph is primarily a graph database; SurrealDB is document. Licensing: Dgraph is open source (permissive) (Apache License 2.0); SurrealDB is source-available (Business Source License 1.1 (converts to Apache 2.0 after 4 years)). Dgraph is built for larger datasets (≤ 1 PB) than SurrealDB (≤ 10 TB).

When should I choose Dgraph over SurrealDB?

Choose Dgraph for GraphQL application backends; knowledge graphs and content relationships; and real-time recommendations. Choose SurrealDB for greenfield apps wanting one backend for documents and relationships; agent memory and knowledge graphs for AI applications; and local-first or in-browser data with WASM.

Is Dgraph or SurrealDB more popular?

SurrealDB ranks #94 on the WhichDB Score (28.8/100) and Dgraph ranks #137 (22.4/100). Popularity is not fit: check the requirements that matter for your project.

Are Dgraph and SurrealDB open source?

Yes. Dgraph is open source. License: Apache License 2.0. Not in the OSI sense. SurrealDB is source-available: you can read the code, but the license restricts some uses, typically offering it as a competing managed service. License: Business Source License 1.1 (converts to Apache 2.0 after 4 years).