Dgraph v21.03: Resilient Rocket Release

It’s time for the first major Dgraph release of 2021. Dgraph v21.03 is also known as the Resilient Rocket release. The Dgraph team took inspiration from Rocket’s brilliant engineering and heavy armory while building the robust features of v21.03.

We heard from you, our community, that our v20.11 release was helpful in ending OOM issues and adding improved experiences and performance. Since the last major release, Dgraph has been focusing on bringing Dgraph Cloud to parity with the open-source version while adding new, highly-requested functionality including multi-tenancy and Apollo Federation.

Be sure to read the detailed release notes and documentation here. An overview of the most important changes follows below.

GraphQL Updates

As a popular part of the GraphQL tech stack, Apollo is a valued part of the GraphQL ecosystem. That’s why Dgraph now natively supports Apollo Federation, which lets you create a gateway GraphQL service that includes the Dgraph GraphQL API and other GraphQL services. As Apollo Federation users, you’ll now have access to the power of Dgraph’s query execution along with your existing GraphQL services. The v21.03 implementation of Apollo Federation supports five directives:

  1. @key: takes one field argument inside it, the @key field.
  2. @extends: support for extended definitions. This can also be achieved with the extend keyword, so this gives you a choice between two types of syntax to extend a type in your Dgraph GraphQL service.
  3. @external: used when the given field isn’t stored in this service. Can only be used on extended type definitions.
  4. @provides: tells the gateway to return a specific fieldset from the base type while fetching the field.
  5. @requires: annotates the fieldset of the base type.

If you’re a fan of serverless development, our update to Lambda webhooks for add/update/delete mutations will be super exciting because you can save on writing tons of custom code, plus add automated functionality to your project. For example:

  • Add a user and directly send a welcome email without additional custom logic.
  • On update, send a notification.
  • Delete users and clean up any hanging elements previously attached to them.

Other GraphQL updates include:

  • Improved GraphQL query performance, with average query latency reduced by 33%
  • Upsert Mutations allow GraphQL clients to perform an add or update operation in a single mutation.
  • Support multiple unique fields
  • Subscriptions to custom DQL

Dgraph Cloud Updates

Along with our updates, we’ve also streamlined our Dgraph Cloud offerings. All our hosted Dgraph options are Dgraph Cloud. If you’re used to Slash GraphQL, here’s how the naming now works:

  • Free, designed for individuals learning and exploring Dgraph, is the free tier of Dgraph Cloud, that includes 1MB per day data transfer
  • Shared, with shared instances for small teams building applications or MVPs, starts at $9.99 per backend/month, with $2 per additional 1GB data transfer
  • Dedicated, with dedicated instances for teams and enterprises developing production-ready applications with massive datasets, HA, and millisecond query speed, starts at $199 per month.

Also important to note, you can now access dedicated instances using our self-service interface - this also offers transparent pricing as you estimate your production-level setup in the Cloud.

Other interesting Dgraph Cloud updates include:

  • No code schema editor for GraphQL & DQL. You can now model your data visually with a few clicks.
  • With Data Visualizer, we have tried to reimagine the way we generate GraphQL queries. You can view, search & filter your data with ease.

Enterprise Features

We are thrilled to share that v21.03 is the official release of multi-tenancy. This improves performance and affordability. Multi-tenancy is an enterprise-only feature that allows various tenants to co-exist in the same Dgraph cluster. Each tenant can only log into and operate in their own namespace or “galaxy” in Dgraph’s naming.

Multi-tenancy is built upon Access Control Lists (ACL). The tenants are logically separated, and their data lies in the same p directory. Each namespace has a group guardian (of the galaxy), which has root access to that namespace.

Dgraph can be integrated with HashiCorp Vault to secure access for the Encryption-At-Rest key so that it is not left on the disk. This feature has been expanded to support the secret key for the Access Control Lists as well. Read more in our how-to guide with configuration examples using Docker Compose.

Another enterprise feature added with v21.03 is audit logging. You can enable audit logging so that all requests are tracked and available for use in security audits. When enabled, it records details about queries and mutations (requests) sent to your database including:

  • Endpoint
  • Logged-in User Name
  • Server host address
  • Client Host address
  • Request Body (truncated at 4KB)
  • Timestamp
  • Namespace
  • Query Parameters (if provided)
  • Response status

Based on user feedback and requests, we’ve added the following enterprise features:

  • Change Data Capture to Kafka
    • Mirror your data across different services like analytic engines and be sure that whenever a predicate is updated in Dgraph, an event will be generated to update the state of the service. You can even use CDC to run workflows, for example giving access to specific groups whenever an event is generated stating that the user is added to an organization.
  • Read replicas (Raft learner node) improving speed and fault tolerance
    • Speed - Use learner nodes to create read-only versions of your database in other geolocations to increase query speed. You can even use best effort queries to further improve multi-region query speed if the eventual consistency model fits your business requirements.
    • Fault tolerance - Get greater peace of mind in the event that your primary data center goes down. Should your main cluster go down, you can simply promote your learner node and continue accepting read/write requests.

Introducing the new GraphQL tour

We have updated Dgraph Tour to include a GraphQL tour. Now with this update, you can learn both standard GraphQL and DQL side-by-side. The site is integrated with Dgraph Cloud, so you can try out the tour with your Dgraph Cloud account.

Introducing Dgraph Superflags

If you’re not using Dgraph Cloud, Dgraph features are configured with a myriad of flags (or command-line arguments). To streamline and improve the experience with v21.03.0, we consolidated several related flags together into a superflag, where you pass in a semi-colon separated list of options to the superflag. Find out more about how to configure Dgraph with the new superflags in our documentation.

Dgraph Helm Chart

Did you know there is a Dgraph Helm chart and a Dgraph-Lambda Helm Chart? You can use this to deploy Dgraph on the Kubernetes platform. You can also find example configurations for Resilient Rocket in the Helm chart git repo.

It is an understatement to say that managing both Kubernetes and Dgraph on top of Kubernetes is operationally complex. As an alternative, you can let Dgraph manage this for you with Dgraph Cloud.

Ending support for running Dgraph on Windows and macOS

In case you missed the Discuss post, we wanted to pause to highlight that this latest version does not feature support for Windows or macOS. You can still run Dgraph through Docker, or using Dgraph Cloud, on Windows or Macs, but native support is no longer a part of our open source product.

End of Dgraph Ratel Releases

Ratel, the web user interface for Dgraph, will no longer be included in Dgraph releases or official Docker images. Instead, you can navigate to https://play.dgraph.io/ to access Ratel, and configure this to point to your Dgraph endpoint.

The Ratel application is a self-contained web application that can connect to any Dgraph, so you don’t need to run a local web service to host the web application. Should you still need to run a local copy of Ratel, you can compile a version from the Ratel source code (see building and running Ratel). For building a Docker image, you can copy the dgraph-ratel binary into a docker image based on Ubuntu or other Linux operating system docker images.

We are really excited about the v21.03 “Resilient Rocket” release because it’s a major leap on our 2021 roadmap. If you haven’t already, please check out our plans for Dgraph in the coming year, and feel free to give us your feedback. We want to make sure that we’re continuing to build the most advanced native GraphQL graph database for you and your projects.