Dgraph Database Overview
Dgraph is a horizontally scalable and distributed GraphQL database with a graph backend. Dgraph is built for the heavy transactional workloads required to power modern apps and websites, but it isn’t limited to only these types of applications. Whether you are looking to power the backend of your app, create elastic search for your website, or build a new database purely for data analysis, Dgraph is up to the task. In fact, it is in production today in the following real-world scenarios:
- Data unification
- Customer 360
- Social media sites
- Content Management Systems
- Ecommerce stores
- Entity resolution
- HR management applications
- Master data management
- Product recommendation engines
- Real-time chat applications
To learn more about how organizations are using Dgraph, see Dgraph Case Studies.
Dgraph database and Dgraph Cloud
You can run Dgraph database in a variety of ways:
- Fully-managed (hosted): Dgraph Cloud provides Dgraph as a fully-managed cloud service. Dgraph Cloud Shared Instances (formerly called Slash GraphQL) give you the power of Dgraph in a low-cost hosted service running on a shared cluster. Dgraph Cloud Dedicated Instances provide an enterprise-grade service that runs on dedicated cluster instances. To learn more, see Fully-Managed Dgraph.
- Self-managed: You can use Dgraph on-premises, hosted on your own physical infrastructure. You can also run Dgraph in your AWS, GCP, or Azure cloud infrastructure.
Dgraph Cloud with shared instances is a fully-managed GraphQL database service that lets you focus on building apps, not managing infrastructure. Dgraph Cloud is built from the ground up to support GraphQL, and uses a graph database structure down to its lowest layers. So it integrates seamlessly with your existing ecosystem of GraphQL tools.
Dgraph Cloud gives you the power of Dgraph database in a hosted environment, providing the flexibility and performance of a horizontally-scalable and distributed GraphQL database with a graph backend, so you don’t need to configure and manage VMs, servers, firewalls, and HTTP endpoints to power your modern apps and websites. Dgraph Cloud with shared instances runs on a shared cluster so we can offer it at a low price. To learn more about Dgraph Cloud, see Dgraph Cloud Overview.
Dgraph Cloud with dedicated instances extends the capabilities of the lower-cost shared instances offering to meet the heavy workloads and other needs of enterprise customers. With Dgraph Cloud, you get dedicated cluster instances, high availability, and the option to run Dgraph in your own virtual private cloud (VPC) or bring your own Kubernetes (BYOK) environment.
Use the instructions in this section to get started using Dgraph Cloud or self-managed Dgraph today.
Get started with Dgraph Cloud
You can get started with Dgraph Cloud today with a free trial. To use Dgraph Cloud, visit our Pricing Page or Pricing Calculator to get an estimate, or contact us.
Get started with self-managed Dgraph
To run Dgraph on your own server, see instructions for single-node setup or instructions for cluster setup.
To run Dgraph using the standalone Docker image
- Download docker: https://www.docker.com/
- Create a folder to store Dgraph data outside of the container, as follows:
mkdir -p ~/dgraph
- Get the Docker standalone image, as follows:
docker pull dgraph/standalone
- Run the Dgraph Docker standalone image, as follows:
docker run -it -p 5080:5080 -p 6080:6080 -p 8080:8080 -p 9080:9080 -p 8000:8000 -v ~/dgraph:/dgraph --name dgraph dgraph/standalone:v21.03.0
v21.03.0in the command shown above to the version number for a previous release, such as
After following these steps, Dgraph Alpha now runs and listens for HTTP requests on port 8080, and Ratel listens on port 8000.
Dgraph and GraphQL
Because Dgraph is a native GraphQL database, queries across sparse data sets run efficiently. As a native GraphQL database, Dgraph doesn’t have a relational database running in the background, so your data has the ability to grow and change with your app, without the need to add new tables. And when it comes time to deploy a new schema, you can do that in seconds, not hours.
To learn more about Dgraph’s GraphQL implementation, see GraphQL Overview. If you are a SQL user, see: Dgraph for SQL Users.
Glossary of Dgraph and GraphQL terms
|Dgraph Cloud||A fully-managed GraphQL database service powered by Dgraph database.||Dgraph Cloud documentation|
|Badger||A fast, open-source key-value database written in pure Go that provides the disk layer for Dgraph database.||Badger documentation|
|data node||A basic unit of data representing an entity in a graph database. Nodes are connected by edges and have predicates (or fields) that contain node data.|
|Dgraph Alpha||A server node that serves data to clients of Dgraph database, and also provides administrator endpoints.||Dgraph Alpha documentation|
|Dgraph database||A horizontally-scalable and distributed GraphQL database with a graph backend.|
|Dgraph Query Language (DQL)||A query language that extends and modifies GraphQL to support deep queries for modern apps. Formerly known as GraphQL+-.||DQL documentation|
|Dgraph Zero||A server node that controls a Dgraph database cluster.||Dgraph Zero documentation|
|edge||A relationship between two data nodes in a graph database.|
|GraphQL||An open-source query language for APIs and a runtime for fulfilling those queries.||Dgraph GraphQL documentation|
|object||See data node.|
|server node||A server that makes up part of a server cluster. See Dgraph Alpha and Dgraph Zero.||Dgraph Cluster Setup documentation|
|superflag||A Dgraph CLI flag that contains one or more options used to specify command settings.||Dgraph Cluster Setup documentation|
|predicate||A property of a data node in a graph database; also a discrete piece of information available to request in a graph database.|