Softwr

Databases · head to head

CockroachDB vs Dgraph

CockroachDB logo

CockroachDB

Databases

The cloud-native distributed SQL database

From
Free
Free plan
Yes
Dgraph logo

Dgraph

Databases

Apache 2.0 distributed graph database written in Go, maintained by Hypermode, queried through GraphQL or its own DQL language.

From
Free
Free plan
Yes

The short version

  • CockroachDB is a cloud-native distributed SQL database.
  • Free plans on both; paid from $0.057/mo and $39/mo.
  • Only CockroachDB lists horizontal Scaling; only Dgraph lists apache 2.0 licence.
  • Where CockroachDB falls short: basic and Standard tiers limited to AWS and GCP (select regions only).

How do CockroachDB and Dgraph differ?

CockroachDB and Dgraph differ on platforms and year founded (2015 against 2016). Only the attributes on which CockroachDB and Dgraph actually diverge.

Attributes where CockroachDB and Dgraph differ
AttributeCockroachDBDgraph
PlatformsAWS, GCP, AzureLinux, macOS, Self-hosted, Web
Founded20152016

Identical on both: starting price (Free), pricing model (Freemium), free tier (Yes), category (Databases).

Which features does each one have?

They share no listed features; 20 appear only for CockroachDB and 10 only for Dgraph. Drawn from each product's published feature list. An absence here means we hold no record of it - not that the product lacks it.

Only in CockroachDB

  • Distributed SQL
  • Automatic Sharding
  • Multi-region Replication
  • Geo-partitioning
  • ACID Transactions
  • Horizontal Scaling
  • Survivability
  • PostgreSQL Compatibility

Only in Dgraph

  • Apache 2.0 licence
  • Generated GraphQL API
  • DQL query language
  • Predicate sharding
  • Raft replication
  • Distributed ACID transactions
  • Written in Go
  • Full-text and geo indexing

What is each one used for?

CockroachDB is most often brought in for distributed SQL database for scalable applications. The jobs each tool is most often brought in to do.

CockroachDB

  • Distributed SQL database for scalable applicationsnot Dgraph
  • Multi-region deployment and failovernot Dgraph

Dgraph

  • An application whose core data is a graph, such as permissions, social connections or product relationships, where the frontend already consumes GraphQLnot CockroachDB
  • A knowledge graph that outgrew a single machine and needs storage distributed across nodes without a per-core licence negotiationnot CockroachDB
  • Recommendation or fraud-detection features that traverse several hops at request time, where a relational join chain has become the bottlenecknot CockroachDB
  • Teams that want a graph database they can read, fork and self-host under a permissive licence rather than a source-available onenot CockroachDB

Where do CockroachDB and Dgraph fall short?

CockroachDB's most cited limit: basic and Standard tiers limited to AWS and GCP (select regions only). Documented limitations, not opinions. Every one is a constraint you would hit in normal use.

CockroachDB

  • Basic and Standard tiers limited to AWS and GCP (select regions only)
  • Azure support restricted to Advanced tier only
  • Basic tier limited to 50 million RUs and 10 GiB storage per month
  • Advanced tier starts at $0.60/hour for 4 vCPUs minimum
  • 3 TiB maximum storage on Basic and Standard tiers, 10 TiB per node on Advanced

Dgraph

  • Sharding is by predicate, so a single very hot predicate lives entirely in one Raft group and cannot be split further; adding nodes does not relieve it and the fix is a data model change
  • Stewardship passed from Dgraph Labs to Hypermode after the original company stopped operating independently, so anyone building on it is betting on a second custodian rather than on the original team's roadmap
  • The GraphQL layer is generated and opinionated, so anything it does not express drops you into DQL, which is a second language your team must learn and which no other database speaks
  • The community is a fraction of Neo4j's, so operational answers, tuning experience, hiring and third-party tooling are all thinner, and unusual failure modes in a Zero and Alpha cluster leave you reading source rather than a forum
  • There is no portable graph standard to migrate to; Cypher, Gremlin and SPARQL are all different query models, so the schema and every query is a rewrite if you later leave, and that cost grows with the application

How much do CockroachDB and Dgraph cost?

CockroachDB has a free plan, with paid plans from $0.057/mo; Dgraph has a free plan, with paid plans from $39/mo. Plan by plan below, from each vendor's own pricing page.

CockroachDB

Free
  • Standard$0.057/vcpu-hour
  • Mission Critical$0.162/vcpu-hour

Dgraph

Free
  • CommunityFree
    • Native GraphQL
    • Graph queries
    • Full-text search
  • Cloud$39/mo
    • Managed service
    • Auto-scaling
    • Enterprise support

Which should you pick?

Choose CockroachDB if

  • You need distributed sql.
  • You want to start without paying.
  • You work on AWS, GCP, Azure.
  • You also want automatic sharding.

Choose Dgraph if

  • You need apache 2.0 licence.
  • You want to start without paying.
  • You work on Linux, macOS, Self-hosted, Web.
  • You also want generated graphql api.

Questions people ask

Is CockroachDB or Dgraph better?
It depends on the job. CockroachDB fits distributed SQL database for scalable applications; Dgraph fits an application whose core data is a graph, such as permissions, social connections or product relationships, where the frontend already consumes GraphQL. CockroachDB starts at Free and Dgraph at Free.
Which is cheaper, CockroachDB or Dgraph?
CockroachDB starts at Free and Dgraph at Free.
Does CockroachDB or Dgraph run on more platforms?
CockroachDB runs on AWS, GCP, Azure. Dgraph runs on Linux, macOS, Self-hosted, Web.
Can I use CockroachDB for free?
Both have a free tier, so you can try either at no cost before committing.
What is CockroachDB best used for?
CockroachDB is most often used for distributed sql database for scalable applications, multi-region deployment and failover. Of those, distributed sql database for scalable applications and multi-region deployment and failover are not what Dgraph is typically brought in for.
What can CockroachDB do that Dgraph cannot?
CockroachDB covers Distributed SQL, Automatic Sharding, Multi-region Replication, Geo-partitioning. Dgraph covers Apache 2.0 licence, Generated GraphQL API, DQL query language, Predicate sharding.

Answered from the vendors’ own pages

CockroachDB: What does the free Basic tier include?

The Basic tier is free and includes 50 million RUs and 10 GiB storage per month, with a maximum compute of 30K RU/sec. No credit card is required to start.

Source
Dgraph: Is Dgraph open source?

Yes. The current repository is Apache 2.0, which is a permissive OSI licence, and the project is at v25 under Hypermode's maintenance.

CockroachDB: How much do the paid tiers cost?

Standard tier starts at $0.18 per hour for 2 vCPUs, and Advanced tier starts at $0.60 per hour for 4 vCPUs. Both tiers support additional resources with higher costs for increased compute and storage.

Source
Dgraph: Is it really GraphQL?

It serves a generated GraphQL API, which is real GraphQL for clients. Its native language, DQL, resembles GraphQL syntactically but is Dgraph's own language and is not the GraphQL specification.

CockroachDB: What are the storage limits for each tier?

Basic plan supports up to 3 TiB storage, Standard tier up to 3 TiB, and Advanced tier up to 10 TiB per node with unlimited total storage.

Source
Dgraph: How does it compare to Neo4j?

Neo4j has the larger ecosystem, Cypher, and far more operational precedent. Dgraph distributes storage across nodes by default and gives you a GraphQL endpoint without writing resolvers. The choice usually turns on whether you need horizontal scale and a GraphQL surface more than you need ecosystem depth.

CockroachDB: Can I get trial credits before paying?

Yes, new users can try CockroachDB free with $400 in credits. The Basic and Standard plans do not require a credit card to start.

Source
Dgraph: What does a production cluster look like?

At minimum a set of Zero nodes for coordination and a replicated set of Alpha nodes for data, typically three of each for fault tolerance, which is a meaningfully larger operational footprint than a single graph server.

CockroachDB: Do legacy contracts have different pricing?

Customers with annual or multi-year contracts entered before December 1, 2024 can view legacy pricing terms on a separate page, which apply until their contract renewal date.

Source
Dgraph: Who maintains it now?

Hypermode. Dgraph Labs, the original company, no longer operates it, and that change of custodian is the main non-technical risk to weigh.

Share

Related pages

Other head to heads