Introduction

I have spent a career building business applications that work with databases, starting with SQL and then moving to No-SQL. I’ve been curious how Graph databases work and how to build applications with them. It seems the sweet spot for a Graph database is when your application needs to model the interrelationships of complex and different datasets. I’ve been using No-SQL databases for these types of applications so I am super interested in knowing how Graph databases differ. After some research, I decided to learn Dgraph and their modified version of GraphQL called GraphQL±.

Dgraph is written in Go and is a relatively new player in the Graph database market. GraphQL is becoming the new DSL for interacting with the database. Since GraphQL wasn’t developed directly for Graph databases, Dgraph modified the language (adding and removing features) to better support graph operations and called it GraphQL±. However when interacting with Dgraph, you do have the choice of using native GraphQL as well.

Note: Dgraph is working on full native support for GraphQL in an upcoming release. You can start experimenting with it now. Native GraphQL will be available to perform basic CRUD and other simple operations. However, you will need GraphQL± to make use of the the full potential of the database.

In this post, I will show you how to install and run a standalone version of Dgraph for use in your development environment. Then I will walk you through a simple example using Dgraph’s UI browser tool Ratel to store and query data from the database using GraphQL±.

Docker

The best way to run Dgraph on your local machine is to use Docker. If you don’t have Docker installed yet, then please use this guide from Docker.

As of the writing of this post, version 20.03.0 is the latest release of the database. To download this version of the Dgraph image, just use the docker pull command.

#graphql #database #web-development #developer

Getting Started With Dgraph and GraphQL+-
3.00 GEEK