Website review
This review may include AI-generated content and is not individually verified. Domain, certificate and other facts come from the observed data on this page.
What is Dgraph Documentation?
Dgraph Documentation is the official documentation site for Dgraph, an open-source, distributed graph database built for real-time workloads and terabyte-scale data. It serves two main purposes: explaining how to run Dgraph directly as a property graph database, and showing how to generate a GraphQL API and graph backend from a GraphQL schema.
The site is organized around two paths:
- Dgraph DB — getting started, using, and operating the database itself, including administration tasks.
- GraphQL API — schema-driven API development, where your GraphQL schema produces both the API and the underlying graph backend.
Who it's for
- Backend and application developers who want a graph data model with a GraphQL interface rather than hand-written resolvers and persistence code.
- Database operators and platform engineers responsible for running, scaling, and maintaining a distributed database.
- Teams evaluating graph databases for connected-data problems such as recommendations, entity relationships, or knowledge graphs.
How to use it
Start with the path that matches your goal. If you want to query and manage the database directly, begin with Dgraph DB. If your priority is shipping an application quickly against a schema you already have, begin with the GraphQL API path. For a concrete example: a team building a product-recommendation feature could define its entities and relationships in a GraphQL schema, let Dgraph generate the API and backend, then use the Dgraph DB material later when it needs to tune or operate the cluster.
Trade-offs to weigh
A graph model suits highly connected data and complex traversals better than rigid relational joins, and the GraphQL API path can reduce boilerplate for schema-driven apps. The cost is operational: a distributed system is more to run than a single-node database, and committing to GraphQL as your interface shapes how clients and schemas evolve. Confirm current deployment and scaling details in the documentation itself before designing around them.
Next step: open Dgraph Documentation and read the Dgraph DB getting-started section first, then the GraphQL API section, so you can judge which path fits your project.
How do I get started with Dgraph DB?
Start with the path that matches how you want to work: Dgraph can be used directly as a property graph database, or through a generated GraphQL API. If you want to run queries, manage data and administer the database yourself, begin with Dgraph DB. If you want a schema-driven API and a graph backend generated from your GraphQL schema, the GraphQL API path is likely the faster route for application development.
A practical first sequence for Dgraph DB
- Read the Dgraph DB "Get started" material before installing anything, so you understand the components you are expected to run.
- Stand up a local or test instance rather than pointing your first experiments at production data.
- Model a small graph that reflects a real question you care about, such as users, products and purchases, or documents and their links.
- Load a few records, then run queries that traverse relationships rather than just returning single records.
- Practice the operational side early: backups, scaling and monitoring are part of the Dgraph DB path, not an afterthought.
Choosing between the two entry points
| Your goal | Better starting point |
|---|---|
| Direct database queries and administration | Dgraph DB |
| Rapid application development from an existing GraphQL schema | GraphQL API |
| Learning how graph traversal works | Dgraph DB |
| Generating an API and graph backend together | GraphQL API |
A concrete example: if you are building a recommendation feature and already have a GraphQL schema, start with the GraphQL API path and let it generate the backend. If you are migrating an existing dataset and need fine control over loading, indexing and queries, start with Dgraph DB.
For the official starting instructions, use Dgraph Documentation. A useful next step is to pick one small dataset you already understand, load it, and write three traversal queries against it before expanding your schema.
How can I use Dgraph's GraphQL API to build an application?
Use Dgraph's GraphQL API as the application-facing layer: you define a GraphQL schema, Dgraph generates a GraphQL endpoint plus a graph backend from it, and your app queries and mutates data through that endpoint instead of managing database internals directly. This is the path Dgraph documents for rapid, schema-driven application development, as opposed to using Dgraph DB directly for property-graph operations and administration.
A practical build sequence
- Model your domain in GraphQL: types, fields, relationships and the queries/mutations your app needs.
- Have Dgraph generate the API and backend from that schema, so the endpoint matches your types.
- Point your client at the generated endpoint and call it like any GraphQL service (queries, mutations, filters, nested relationship traversal).
- Iterate on the schema as the app evolves, rather than hand-writing resolvers and database access code.
A concrete scenario
Suppose you are building a product catalog with categories, products, and suppliers. You define those as GraphQL types with edges between them. Your front end then asks for a category and its products and each product's supplier in one query, and your admin screen creates or updates products through mutations. The graph shape of the data is expressed once in the schema and reused by both screens.
Which path to choose
| Situation | Better fit |
|---|---|
| You want an app-facing API generated from a GraphQL schema, with minimal backend code | GraphQL API |
| You need direct database operations, custom administration, or non-GraphQL access patterns | Dgraph DB |
| Your team already writes GraphQL clients and wants schema-driven development | GraphQL API |
Trade-off to weigh: the GraphQL API buys speed of development and a schema as the single contract, but it constrains you to what can be expressed through that generated API. If you need lower-level control, unusual query patterns, or operational tooling, the direct database path is more flexible but requires you to build more yourself.
Next step
Write the smallest useful schema for your app — two or three types with one relationship — generate the API, and run one nested query and one mutation against it. If that round trip covers your core use case, expand the schema from there; if it fights you, evaluate the direct database path before investing further.
Start from the documentation at Dgraph Documentation, which splits into the Dgraph DB and GraphQL API sections and is the authoritative reference for schema and endpoint behavior.
How does Dgraph achieve real-time performance and horizontal scalability?
Dgraph achieves real-time performance and horizontal scalability by design: it is a distributed graph database that splits data across multiple machines and runs queries in parallel. Rather than routing every traversal through a single server, work is spread across the cluster, so larger datasets and heavier query loads are handled by adding nodes instead of replacing hardware. The documentation describes it as open-source, distributed, highly available and built for real-time workloads, with parallel query processing to return fast results even for complex traversals.
Two practical paths shape how teams use it, as outlined on Dgraph Documentation:
- Dgraph DB: direct property-graph operations and administration, suited to teams that want control over schema, queries and cluster operations.
- GraphQL API: generate a GraphQL API and graph backend from a GraphQL schema, suited to application teams that want a schema-driven API without hand-writing the backend.
When horizontal scalability matters most
| Scenario | Why distribution helps |
|---|---|
| Terabyte-scale graphs with deep traversals | Data and query work are spread across nodes, so a single machine is not the bottleneck |
| Real-time recommendation or identity graphs | Parallel query execution reduces latency under concurrent load |
| Rapid application development | A generated GraphQL API shortens the path from schema to working backend |
A useful next step is to decide which path fits your team: if you need direct control over graph operations and cluster administration, start with the Dgraph DB documentation; if you want to move quickly from a GraphQL schema to a running API, start with the GraphQL API section. Then test with a representative query pattern and dataset size, because real-time behavior depends on query shape, indexing and cluster sizing, not just on the database's architecture.
What are the differences between using Dgraph as a property graph database and using the GraphQL API?
The main difference is what you control versus what Dgraph generates for you. Using Dgraph DB directly means you model and query a property graph yourself; using the GraphQL API means you supply a GraphQL schema and Dgraph derives both the API and the graph backend from it. Both paths lead to the same underlying graph database, so the choice is mostly about interface and workflow, not different storage engines.
Dgraph DB (property graph)
- You work with Dgraph's own query language and graph operations directly.
- You define predicates, types and indexes, and you administer the cluster yourself.
- Best when you need low-level control over data modeling, migrations, or operations, or when your clients are not GraphQL.
- Trade-off: more database-specific knowledge required, and you own schema evolution and query design.
GraphQL API
- You write a GraphQL schema; Dgraph generates a GraphQL API plus the graph backend behind it.
- Schema-driven development: the schema is the contract, which suits application teams building front ends quickly.
- Best when your application already speaks GraphQL or you want fast iteration on API shape.
- Trade-off: you work within what the generated API supports; less direct control over the underlying graph than querying the database yourself. Some database-level operations are handled through the DB path rather than the GraphQL layer.
Quick comparison
| Aspect | Dgraph DB | GraphQL API |
|---|---|---|
| Interface | Direct graph queries and administration | GraphQL endpoint generated from your schema |
| Modeling | You define predicates and types | You define a GraphQL schema |
| Control | High, down to database operations | Bounded by what the generated API exposes |
| Speed to first API | Slower, more setup | Faster for GraphQL clients |
| Best fit | DBAs, backend/data engineers, non-GraphQL clients | App teams with GraphQL clients |
How to choose
Pick the GraphQL API if your primary consumer is a GraphQL application and you want the schema to drive both API and storage. Pick direct Dgraph DB use if you need fine-grained graph modeling, custom queries, or operational control, or if your clients use other protocols. They are not mutually exclusive: many teams expose a GraphQL API to applications while using the DB path for administration and advanced graph work.
Next step: write down your main client type and the two or three queries that matter most, then test which path expresses them with less friction. Start with the overview at Dgraph Documentation.
How do I operate and administer a Dgraph database in production?
Operate Dgraph in production by treating it as a distributed cluster you deploy, monitor, back up, and upgrade deliberately — not as a single local binary. The documentation at Dgraph Documentation splits this into two paths: Dgraph DB for direct database operations and administration, and the GraphQL API for schema-driven application development. Production administration lives mostly in the first path.
Core production tasks
- Deploy a distributed cluster. Dgraph is designed as a distributed system, so production means multiple nodes (Zero and Alpha roles in a Dgraph deployment) rather than one process. The docs' "Get started, use and operate" section is the place to work through cluster setup before you touch data.
- Plan for scale and availability. The project describes itself as open-source, scalable, distributed, and highly available, with queries processed in parallel. That shapes your runbook: you need to think about replication, node failure, and rebalancing, not just query tuning.
- Manage schema and data. Schema changes, data loading, and exports are routine admin work. Decide early whether your schema is owned by the database directly or generated from a GraphQL schema.
- Back up and restore. Treat backups as a scheduled, tested procedure. Verify restores into a non-production cluster so you know recovery actually works.
- Monitor and upgrade. Watch cluster health and query latency, and follow the docs' upgrade guidance rather than jumping versions.
Which path fits your team
| Situation | Better fit |
|---|---|
| You control the database directly, run admin operations, tune queries | Dgraph DB |
| You want a schema-driven API generated from a GraphQL schema for fast app development | GraphQL API |
A practical scenario: a small platform team running a real-time recommendation feature would deploy a multi-node Dgraph cluster, load data through the DB path, and expose a GraphQL API to application developers — keeping admin access restricted to the operations team.
Next step
Open the Dgraph DB "Get started, use and operate" pages and turn them into a checklist: cluster topology, backup schedule, monitoring, and upgrade procedure. If your team is GraphQL-first, read the GraphQL API section alongside it to decide where schema ownership should sit.
User reviews (0)