SlideShare a Scribd company logo
GraphQL & DGraph with GO
1
James tan
@ Okestra Systems Sdn Bhd | https://okestra.co/ | james@okestra.co | 0123221812
2
Workflow management simplified
Let’s make GO fun!
With AI (soon)
What is GraphQL?
GraphQL is a query language for APIs and a runtime for fulfilling those queries
with your existing data.
3
Who uses GraphQL?
4
And more @ https://graphql.org/users/

Recommended for you

Parallel/Distributed Deep Learning and CDSW
Parallel/Distributed Deep Learning and CDSWParallel/Distributed Deep Learning and CDSW
Parallel/Distributed Deep Learning and CDSW

Deep learning (DL) is still one of the fastest developing areas in machine learning. As models increase their complexity and data sets grow in size, your model training can last hours or even days. In this session we will explore some of the trends in Deep Neural Networks to accelerate training using parallelize/distribute deep learning. We will also present how to apply some of these strategies using Cloudera Data Science Workbenck and some popular (DL) open source frameworks like Uber Horovod, Tensorflow and Keras. Speakers Rafael Arana, Senior Solutions Architect Cloudera Zuling Kang, Senior Solutions Architect Cloudera Inc.

dataworks summit barcelonadws19artificial intelligence and data science
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra

This document introduces Apache Cassandra, a distributed column-oriented NoSQL database. It discusses Cassandra's architecture, data model, query language (CQL), and how to install and run Cassandra. Key points covered include Cassandra's linear scalability, high availability and fault tolerance. The document also demonstrates how to use the nodetool utility and provides guidance on backing up and restoring Cassandra data.

nosqlcassandrabackup
Apache Hadoopの未来 3系になって何が変わるのか?
Apache Hadoopの未来 3系になって何が変わるのか?Apache Hadoopの未来 3系になって何が変わるのか?
Apache Hadoopの未来 3系になって何が変わるのか?

2017年10月30日に開催されたNTTデータ テクノロジーカンファレンス2017での講演資料です。 Apache Hadoopの未来 3系になって何が変わるのか? Introduction of Apache Hadoop security isssue and Hitchhiker Erasure Coding algorithm

hadoop
Trusty REST
GET, POST, HEAD, DELETE, OPTIONS, PUT, TRACE, CONNECT
GET /pages
GET /pages/5
POST /pages
PUT /pages/5
DELETE /pages/5
Examples:
5
Why GraphQL
6
Multiple Round
Trip
7
● fetch /pages/1
● fetch /comments?pageID=1
● fetch /users/2
query page($id: Int) {
page(ID: $id) {
title
description
comments {
id
message
created_by {
id
name
}
}
}
}
REST:
GraphQL:
Multiple Round
Trip
8
● fetch /pages/1
● fetch /comments?pageID=1
● fetch /users/2
query page($id: Int) {
page(ID: $id) {
title
description
comments {
id
message
created_by {
id
name
}
}
}
announcements() {
edges {
node: {
id
title
message
}
}
}
REST:
GraphQL:

Recommended for you

インフラエンジニアのためのcassandra入門
インフラエンジニアのためのcassandra入門インフラエンジニアのためのcassandra入門
インフラエンジニアのためのcassandra入門
cassandra
Kafka・Storm・ZooKeeperの認証と認可について #kafkajp
Kafka・Storm・ZooKeeperの認証と認可について #kafkajpKafka・Storm・ZooKeeperの認証と認可について #kafkajp
Kafka・Storm・ZooKeeperの認証と認可について #kafkajp

Apache Kafka Meetup Japan #3 https://kafka-apache-jp.connpass.com/event/58619/ 発表資料

kafka
Apache HBase 入門 (第1回)
Apache HBase 入門 (第1回)Apache HBase 入門 (第1回)
Apache HBase 入門 (第1回)

The document discusses big data and Hadoop concepts. It covers Hadoop operations like put, get, scan, filter, delete as well as join and group by. It also discusses the different types of data access patterns like random write, sequential read, sequential write and random read. The document focuses on big data, Hadoop operations, and data access patterns.

hbasehadoop
Over fetching data
9
● Frontend: fetch /pages
● Admin: fetch /pages
Frontend:
Admin:
title date
description
title date
description
...
ID title Created by Created on Published
1 Title here ... ... Yes
2 comments
5 comments
[
{ id: 1, title: “title”,
description: “...”,
created_at: “...”,
created_by: { name: “...” },
Comments_count: 2
}, …
]
REST Frontend & admin:
Over fetching data
10
Frontend:
Admin:
title date
description
title date
description
...
ID title Created by Created on Published
1 Title here ... ... Yes
2 comments
5 comments
query page($id: Int) {
page(ID: $id) {
title
description
Comment_count
…
}}
GraphQL frontend:
query page($id: Int) {
page(ID: $id) {
Title
…
}}
GraphQL admin:
Schema Documentation
11
Allow API Discovery and exploration
REST:
schema {
query: Query
mutation: Mutation
}
type Query {
user(email: String!): User
users(first: Int, after: String): UsersConnection!
}
type Mutation {
createUser(email: String!, password: String!): User
}
Implementing GraphQL
● graphql-go: An implementation of GraphQL for Go / Golang.
● graph-gophers/graphql-go: An active implementation of GraphQL in Golang (was
https://github.com/graph-gophers/graphql-go).
● GQLGen - Go generate based graphql server library.
● graphql-relay-go: A Go/Golang library to help construct a graphql-go server supporting
react-relay.
● machinebox/graphql: An elegant low-level HTTP client for GraphQL.
● samsarahq/thunder: A GraphQL implementation with easy schema building, live queries,
and batching
12
https://graphql.org/code/#go

Recommended for you

BigQuery walk through.pptx
BigQuery walk through.pptxBigQuery walk through.pptx
BigQuery walk through.pptx

Google BigQuery is a cloud data warehouse and spreadsheet database that allows users to import, store, and query data in various formats like CSV, JSON, and Google Sheets. It provides a sandbox account with 10GB of free storage and 1TB of free queries per month. To use it, users create a BigQuery project, import data into datasets and tables, and then query the data using SQL syntax.

bigquerygcpgoogle analytics
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...

Apache Kafak의 성능이 특정환경(데이터 유실일 발생하지 않고, 데이터 전송순서를 반드시 보장)에서 어느정도 제공하는지 확인하기 위한 테스트 결과 공유 데이터 전송순서를 보장하기 위해서는 Apache Kafka cluster로 partition을 분산할 수 없게되므로, 성능향상을 위한 장점을 사용하지 못하게 된다. 이번 테스트에서는 Apache Kafka의 단위 성능, 즉 partition 1개에 대한 성능만을 측정하게 된다. 향후, partition을 증가할 경우 본 테스트의 1개 partition 단위 성능을 기준으로 예측이 가능할 것 같다.

apache kafkabenchmarkthroughput
20191115-PGconf.Japan
20191115-PGconf.Japan20191115-PGconf.Japan
20191115-PGconf.Japan

PostgreSQLカンファレンス2019での発表資料です。 PostgreSQLだってビッグデータ処理したい!! ~GPUとNVMEを駆使して毎秒10億レコードを処理する技術~

postgresqlgpunvme
Graphql-go
● minimal API
● support for context.Context
● support for the OpenTracing standard
● schema type-checking against resolvers
● resolvers are matched to the schema based on method sets (can resolve a GraphQL schema with a Go
interface or Go struct).
● handles panics in resolvers
● parallel execution of resolvers
● Subscriptions
https://github.com/graph-gophers/graphql-go
13
Setup
graphqlSchema := graphql.MustParseSchema(schema.GetRootSchema(), &resolver.Resolver{})
http.Handle("/graphql", h.AddContext(ctx,
graphqlupload.Handler(
&h.GraphQL{Schema: graphqlSchema},
),
))
Endpoint: https://yourdomain.com/graphql
https://github.com/u007/gographqlstart - sample source code
14
Structure
15
16

Recommended for you

Beyond SQL: Speeding up Spark with DataFrames
Beyond SQL: Speeding up Spark with DataFramesBeyond SQL: Speeding up Spark with DataFrames
Beyond SQL: Speeding up Spark with DataFrames

This document summarizes Spark SQL and DataFrames in Spark. It notes that Spark SQL is part of the core Spark distribution and allows running SQL and HiveQL queries. DataFrames provide a way to select, filter, aggregate and plot structured data like in R and Pandas. DataFrames allow writing less code through a high-level API and reading less data by using optimized formats and partitioning. The optimizer can optimize queries across functions and push down predicates to read less data. This allows creating and running Spark programs faster.

apache sparkspark sqlspark summit
[GKE & Spanner 勉強会] Cloud Spanner の技術概要
[GKE & Spanner 勉強会] Cloud Spanner の技術概要[GKE & Spanner 勉強会] Cloud Spanner の技術概要
[GKE & Spanner 勉強会] Cloud Spanner の技術概要

2020 年 1 月 21 日開催 GKE & Cloud Spanner 勉強会【基礎編】 セッション:Cloud Spanner の技術概要 講師:サミール ハムディ    ゲーム ソリューション アーキテクト

google cloud platformcloud spanner
IoTデバイスデータ収集の難しい点
IoTデバイスデータ収集の難しい点IoTデバイスデータ収集の難しい点
IoTデバイスデータ収集の難しい点

Mobility Technologiesではタクシーに取り付けたデバイスのデータを収集していますが、Webとは違うIoTならではの問題や障害を経験しました。それを紹介します。

mobility technologiesiotbig data
How it works
17
http.Handle Schema.Exec Query resolver
Mutation
resolver
Model resolver
Return
Query resolver
Mutation
resolver
Query & Mutation example
● Query - query list / single object
● Mutation - update, delete, create
● Subscription - subscribe to update or event
https://github.com/u007/gographqlstart/blob/master/resolver/user_query.go
https://github.com/u007/gographqlstart/blob/master/resolver/user_mutation.go
18
Demo...
19
Questions?
20

Recommended for you

Kafkaを活用するためのストリーム処理の基本
Kafkaを活用するためのストリーム処理の基本Kafkaを活用するためのストリーム処理の基本
Kafkaを活用するためのストリーム処理の基本

2016/05/31 Apache Kafka Meetup Japan #1 での発表資料

kafka
How Dashtable Helps Dragonfly Maintain Low Latency
How Dashtable Helps Dragonfly Maintain Low LatencyHow Dashtable Helps Dragonfly Maintain Low Latency
How Dashtable Helps Dragonfly Maintain Low Latency

Dashtable is a hashtable implementation inside Dragonfly. It supports incremental resizes and fast, cache-friendly operations. In this talk, we will learn how Dashtable helps Dragonfly to keep its tail latency in check. In Dashtable, long-tail latencies have been reduced by a factor of 1000x, but P999 are 7x longer. Find out why we still think this is a good tradeoff.

high throughput and low latencyp99p99 conf
dbt 101
dbt 101dbt 101
dbt 101

Dbt 기초내용을 다룹니다

What is DGraph?
21
https://dgraph.io/
What is DGraph?
22
https://dgraph.io/
What is DGraph?
23
https://dgraph.io/
What is DGraph?
24
Dgraph is a distributed, low-latency, high throughput graph database, written in Go. It puts a lot of emphasis on good
design, concurrency and minimizing network calls required to execute a query in a distributed environment.
Why build Dgraph?
We think graph databases are currently second class citizens. They are not considered mature enough to be run as the
sole database, and get run alongside other SQL/NoSQL databases. Also, we’re not happy with the design decisions of
existing graph databases, which are either non-native or non-distributed, don’t manage underlying data or suffer from
performance issues.
Is Dgraph production ready?
We recommend Dgraph to be used in production at companies.
https://dgraph.io/

Recommended for you

At least onceってぶっちゃけ問題の先送りだったよね #kafkajp
At least onceってぶっちゃけ問題の先送りだったよね #kafkajpAt least onceってぶっちゃけ問題の先送りだったよね #kafkajp
At least onceってぶっちゃけ問題の先送りだったよね #kafkajp

Apache Kafka Meetup Japan #3 https://kafka-apache-jp.connpass.com/event/58619/ 発表資料

kafka
Hadoop et son écosystème - v2
Hadoop et son écosystème - v2Hadoop et son écosystème - v2
Hadoop et son écosystème - v2

Hadoop et son écosystème

GraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxGraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptx

GraphQL is a query language for APIs that allows clients to request specific data rather than entire resources. It addresses common problems with REST APIs like over-fetching data. Several GraphQL libraries exist for Java including graphql-java, graphql-java-kickstart, graphql-dgs-framework, and spring-graphql. These libraries differ in features like code generation, error handling, testing support, and available clients. Spring GraphQL is considered the most mature option as it integrates directly with Spring Boot and allows testing all code.

Why DGraph
Why Graph db.
25
What is Graph database?
26
What is Graph?
A graph is composed of two elements: a node and a relationship.
Each node represents an entity (a person, place, thing, category or other piece of data), and each relationship
represents how two nodes are associated. This general-purpose structure allows you to model all kinds of
scenarios – from a system of roads, to a network of devices, to a population’s medical history or anything else
defined by relationships.
source: https://neo4j.com/why-graph-databases/
What is Graph database?
27
A graph database is an online database management system with Create, Read, Update and Delete (CRUD)
operations working on a graph data model.
source: https://neo4j.com/why-graph-databases/
Why Graph database?
28source: https://neo4j.com/why-graph-databases/

Recommended for you

GraphQL And Relay Modern
GraphQL And Relay ModernGraphQL And Relay Modern
GraphQL And Relay Modern

The document discusses GraphQL and Relay Modern. It begins with an overview of REST and some of its issues. It then covers what GraphQL is, how it was created at Facebook, and some of its key features like being version-free and having a hierarchical data structure. The document also discusses Relay Modern and what it provides for managing GraphQL queries and mutations. It includes examples of using GraphQL schemas and Relay to fetch and display basic and list data.

relayjsserverlessreactjs
GraphQL and Relay Modern
GraphQL and Relay ModernGraphQL and Relay Modern
GraphQL and Relay Modern

Brad Pillow's presention on GraphQL and Relay Modern at the June 7th Carmel JavaScript Roundabout meetup. Brad is the Chief Architect at WorkHere.com

relaygraphqljavascript
GraphQL And Relay Modern
GraphQL And Relay ModernGraphQL And Relay Modern
GraphQL And Relay Modern

This document discusses GraphQL and Relay Modern. It begins with an overview of REST and its issues. It then covers what GraphQL is, how it was created at Facebook, and its motivations. Key aspects of GraphQL discussed include its single endpoint, hierarchical nature, strong typing, response mirroring the query, and introspection capabilities. The document also discusses Relay Modern and what it provides like declarative queries and mutations. It provides examples of simple GraphQL schemas and Relay components. In the end, it discusses subscriptions, routing, debugging, and resources for learning more.

graphqlrelayjsreactjs
Performance
Example SQL with “Join”s
SELECT 'paper_review'::text AS type, paper_reviews.id, paper_reviews.user_id, concat_ws(' '::text, users.first_name, users.last_name) AS
user_full_name, users.title AS user_title, users.photo AS user_photo, users.organization AS user_organization, users.username,
paper_reviews.paper_id, NULL::character varying AS language_framework, NULL::text AS performance_description, paper_reviews.score_tech,
paper_reviews.score_original,
( SELECT count(comments.id) AS count FROM public.comments WHERE ((comments.source_id = paper_reviews.id) AND (comments.vote = 1))) AS
likes_count,
( SELECT count(comments.id) AS count FROM public.comments WHERE ((comments.source_id = paper_reviews.id) AND (comments.vote = 0))) AS
comments_count FROM ((public.paper_reviews LEFT JOIN public.papers ON ((paper_reviews.paper_id = papers.id))) LEFT JOIN public.users ON
((paper_reviews.user_id = users.id)))
UNION SELECT 'paper_code'::text AS type, paper_codes.id, paper_codes.user_id, concat_ws(' '::text, users.first_name, users.last_name) AS
user_full_name, users.title AS user_title, ...
Why Graph database?
29
Performance
NoSQL
Multiple round trip to database server
GraphDB
Single Query with additional relation mapping
Why Graph database?
30
Flexibility
SQL based:
More joins!, more indexing, more optimisations, more group by OR more sub select, or refactor
NoSQL based:
More round trip for additional collection, more indexing
GraphDB
Add relation, add to graphql query, more indexing (for non relation field)
Why Graph database?
31
Agility
Flexible schema, alike nosql
Add more nodes to distribute queries (dgraph - distributed)
Why Graph database?
32

Recommended for you

GraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database accessGraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database access

GraphQL is a query language mostly used to streamline access to REST APIs. It is seeing tremendous growth and adoption, in organizations like Airbnb, Coursera, Docker, GitHub, Twitter, Uber, and Facebook, where it was invented. As REST APIs are proliferating, the promise of accessing them all through a single query language and hub, which is what GraphQL and GraphQL server implementations bring, is alluring. A significant recent addition to GraphQL was SDL, its schema definition language. SDL enables developers to define a schema governing interaction with the back-end that GraphQL servers can then implement and enforce. Prisma is a productized version of the data layer leveraging GraphQL to access any database. Prisma works with MySQL, Postgres, and MongoDB, and is adding to this list. Prisma sees the GraphQL community really coming together around the idea of schema-first development, and wants to use GraphQL SDL as the foundation for all interfaces between systems.

graphqlapiprisma
Neo4j Morpheus: Interweaving Table and Graph Data with SQL and Cypher in Apac...
Neo4j Morpheus: Interweaving Table and Graph Data with SQL and Cypher in Apac...Neo4j Morpheus: Interweaving Table and Graph Data with SQL and Cypher in Apac...
Neo4j Morpheus: Interweaving Table and Graph Data with SQL and Cypher in Apac...

This document discusses property graphs and how they are represented and queried using Morpheus, a graph query engine for Apache Spark. Morpheus allows querying property graphs using Cypher and represents property graphs using DataFrames, with node and relationship data stored in tables. It integrates with various data sources and supports federated queries across multiple property graphs. The document provides examples of loading property graph data from sources like JSON, SQL databases and Neo4j, creating graph projections, running analytical queries, and recommending businesses based on graph algorithms.

GraphQL & Prisma from Scratch
GraphQL & Prisma from ScratchGraphQL & Prisma from Scratch
GraphQL & Prisma from Scratch

The document discusses Prisma and GraphQL. It provides an overview of GraphQL concepts like schema, queries, and resolvers. It then covers the typical architecture of a GraphQL server including the schema definition, resolver functions, and server setup. Finally, it introduces Prisma as a database access layer that can be used to build GraphQL servers.

graphqlprisma
DGraph Setup
● Zero node: controls the Dgraph cluster, assigns servers to a group and re-balances data between server
groups
● Alpha node: hosts predicates and indexes
● Ratel: UI to run queries, mutations & altering schema (alike pgadmin)
https://docs.dgraph.io/get-started/
https://tour.dgraph.io/intro/1/
https://gist.github.com/u007/f47f9e42ae4f7a94b29c542955d698bc - docker-compose example
33
DGraph: Declaring schema
name: string @index(term) @lang .
age: int @index(int) .
friend: uid @count @reverse .
https://tour.dgraph.io/basic/3/ - data types
https://docs.dgraph.io/query-language/#schema-types
https://docs.dgraph.io/query-language/#indexing
34
DGraph: GO Client
go get -u -v github.com/dgraph-io/dgo
---
conn, err := grpc.Dial("localhost:9080", grpc.WithInsecure())
if err != nil {
log.Fatal(err)
}
defer conn.Close()
dgraphClient := dgo.NewDgraphClient(api.NewDgraphClient(conn))
op := &api.Operation{
Schema: `name: string @index(exact) .
age: int @index(int) .`,
}
err := dgraphClient.Alter(ctx, op) 35
DGraph: Updating/Deleting/Mutate
txn := dgraphClient.NewTxn()
defer txn.Discard(ctx)
type Person struct {
Uid string `json:"uid,omitempty"`
Name string `json:"name,omitempty"`
}
p := Person{
Uid: "_:alice",//optional
Name: "Alice",
}
36
pb, err := json.Marshal(p)
if err != nil {
log.Fatal(err)
}
mu := &api.Mutation{
SetJson: pb,
}
assigned, err := txn.Mutate(ctx, mu)
if err != nil {
log.Fatal(err)
}

Recommended for you

GraphQL-ify your API - JFall 2022
GraphQL-ify your API - JFall 2022GraphQL-ify your API - JFall 2022
GraphQL-ify your API - JFall 2022

GraphQL is query language for APIs, but what are the advantages and how would one implement such in their microservices/APIs. In this session, I will go through the basics of GraphQL, different aspects of GraphQL and architecture of such APIs. How 4 different ways we can implement GraphQL for a Springboot microservice/API.

javaspringbootgraphql
GraphQL IndyJS April 2016
GraphQL IndyJS April 2016GraphQL IndyJS April 2016
GraphQL IndyJS April 2016

This document discusses GraphQL, a query language for APIs and a runtime for fulfilling queries with existing data. It provides examples of basic queries, nested fields, connections, arguments, and fragments. It also covers GraphQL types including scalars, schemas, definitions, predicates, and data resolution. GraphQL allows clients to define the structure of the data required, and specifies querying, modifying, and transmitting data between client and server.

reactjsgraphql
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)

The document discusses graph computations and Pregel, an API for graph processing. It introduces Pregel's vertex-centric programming model where computation is organized into supersteps and depends only on neighboring vertices. Examples like PageRank are shown implemented in Pregel. GraphX is also introduced as a library providing Pregel-like abstractions on Spark. The document then discusses distributing matrix computations, covering partitioning schemes for matrices and how to distribute operations like multiplication and singular value decomposition (SVD) across a cluster.

apache sparkspark summit 2015
DGraph: Committing transaction / discard
txn := dgraphClient.NewTxn()
defer txn.Discard(ctx)
err := txn.Commit(ctx)
if err == y.ErrAborted {
// Retry or handle error
}
37
DGraph: Query Single object
q := `query all($a: string) {
all(func: eq(name, $a)) {
name
}
}`
resp, err := txn.QueryWithVars(ctx, q,
map[string]string{"$a": "Alice"})
fmt.Println(string(resp.Json))
{
user(func: uid(0xc351)) {
First_name
Last_name
Email
roles: with_role {
Uid
Name
}
}
}
38
DGraph: Query list
users(func: eq(_type, "users"), first: 10,
offset:0, orderdesc: created_at)
@filter(has(with_role)) {
uid
email
first_name
company : work_for {
uid
code
name
}
}
}
39
Questions?
40

Recommended for you

ScalaTo July 2019 - No more struggles with Apache Spark workloads in production
ScalaTo July 2019 - No more struggles with Apache Spark workloads in productionScalaTo July 2019 - No more struggles with Apache Spark workloads in production
ScalaTo July 2019 - No more struggles with Apache Spark workloads in production

Scala Toronto July 2019 event at 500px. Pure Functional API Integration Apache Spark Internals tuning Performance tuning Query execution plan optimisation Cats Effects for switching execution model runtime. Discovery / experience with Monix, Scala Future.

functional programmingscalacats
GraphQL-ify your APIs
GraphQL-ify your APIsGraphQL-ify your APIs
GraphQL-ify your APIs

GraphQL is query language for APIs, but what are the advantages and how would one implement such in their microservices/APIs. In this session, I will go through the basics of GraphQL, different aspects of GraphQL and architecture of such APIs. There will be a demo/live-coding on, how 4 different ways we can implement GraphQL for a Springboot microservice/API. Lots of examples, live coding and helpful comparison on structure, usage and implementations of GraphQL in Springboot & Java world.

jbcn22graphqlspringboot
GraphQL + relay
GraphQL + relayGraphQL + relay
GraphQL + relay

A complete presentation of GraphQL and Relay Video : https://www.youtube.com/watch?v=Q0ccA3p5qPM&feature=youtu.be

graphqljsrelayjavascript
Me want more...
● https://github.com/graph-gophers/graphql-go
● https://graphql.org/learn/
● https://docs.dgraph.io/get-started/
● DGraph quick start:
https://gist.github.com/u007/5f68d68d9ee5ad30a10b92ed932b1639
41

More Related Content

What's hot

Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~
Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~
Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~
NTT DATA OSS Professional Services
 
Cassandraのしくみ データの読み書き編
Cassandraのしくみ データの読み書き編Cassandraのしくみ データの読み書き編
Cassandraのしくみ データの読み書き編
Yuki Morishita
 
Planet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: Bigdam
SATOSHI TAGOMORI
 
Parallel/Distributed Deep Learning and CDSW
Parallel/Distributed Deep Learning and CDSWParallel/Distributed Deep Learning and CDSW
Parallel/Distributed Deep Learning and CDSW
DataWorks Summit
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
Gokhan Atil
 
Apache Hadoopの未来 3系になって何が変わるのか?
Apache Hadoopの未来 3系になって何が変わるのか?Apache Hadoopの未来 3系になって何が変わるのか?
Apache Hadoopの未来 3系になって何が変わるのか?
NTT DATA OSS Professional Services
 
インフラエンジニアのためのcassandra入門
インフラエンジニアのためのcassandra入門インフラエンジニアのためのcassandra入門
インフラエンジニアのためのcassandra入門
Akihiro Kuwano
 
Kafka・Storm・ZooKeeperの認証と認可について #kafkajp
Kafka・Storm・ZooKeeperの認証と認可について #kafkajpKafka・Storm・ZooKeeperの認証と認可について #kafkajp
Kafka・Storm・ZooKeeperの認証と認可について #kafkajp
Yahoo!デベロッパーネットワーク
 
Apache HBase 入門 (第1回)
Apache HBase 入門 (第1回)Apache HBase 入門 (第1回)
Apache HBase 入門 (第1回)
tatsuya6502
 
BigQuery walk through.pptx
BigQuery walk through.pptxBigQuery walk through.pptx
BigQuery walk through.pptx
VikRam S
 
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
SANG WON PARK
 
20191115-PGconf.Japan
20191115-PGconf.Japan20191115-PGconf.Japan
20191115-PGconf.Japan
Kohei KaiGai
 
Beyond SQL: Speeding up Spark with DataFrames
Beyond SQL: Speeding up Spark with DataFramesBeyond SQL: Speeding up Spark with DataFrames
Beyond SQL: Speeding up Spark with DataFrames
Databricks
 
[GKE & Spanner 勉強会] Cloud Spanner の技術概要
[GKE & Spanner 勉強会] Cloud Spanner の技術概要[GKE & Spanner 勉強会] Cloud Spanner の技術概要
[GKE & Spanner 勉強会] Cloud Spanner の技術概要
Google Cloud Platform - Japan
 
IoTデバイスデータ収集の難しい点
IoTデバイスデータ収集の難しい点IoTデバイスデータ収集の難しい点
IoTデバイスデータ収集の難しい点
Tetsutaro Watanabe
 
Kafkaを活用するためのストリーム処理の基本
Kafkaを活用するためのストリーム処理の基本Kafkaを活用するためのストリーム処理の基本
Kafkaを活用するためのストリーム処理の基本
Sotaro Kimura
 
How Dashtable Helps Dragonfly Maintain Low Latency
How Dashtable Helps Dragonfly Maintain Low LatencyHow Dashtable Helps Dragonfly Maintain Low Latency
How Dashtable Helps Dragonfly Maintain Low Latency
ScyllaDB
 
dbt 101
dbt 101dbt 101
dbt 101
건 손
 
At least onceってぶっちゃけ問題の先送りだったよね #kafkajp
At least onceってぶっちゃけ問題の先送りだったよね #kafkajpAt least onceってぶっちゃけ問題の先送りだったよね #kafkajp
At least onceってぶっちゃけ問題の先送りだったよね #kafkajp
Yahoo!デベロッパーネットワーク
 
Hadoop et son écosystème - v2
Hadoop et son écosystème - v2Hadoop et son écosystème - v2
Hadoop et son écosystème - v2
Khanh Maudoux
 

What's hot (20)

Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~
Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~
Apache Kafkaって本当に大丈夫?~故障検証のオーバービューと興味深い挙動の紹介~
 
Cassandraのしくみ データの読み書き編
Cassandraのしくみ データの読み書き編Cassandraのしくみ データの読み書き編
Cassandraのしくみ データの読み書き編
 
Planet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: Bigdam
 
Parallel/Distributed Deep Learning and CDSW
Parallel/Distributed Deep Learning and CDSWParallel/Distributed Deep Learning and CDSW
Parallel/Distributed Deep Learning and CDSW
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
 
Apache Hadoopの未来 3系になって何が変わるのか?
Apache Hadoopの未来 3系になって何が変わるのか?Apache Hadoopの未来 3系になって何が変わるのか?
Apache Hadoopの未来 3系になって何が変わるのか?
 
インフラエンジニアのためのcassandra入門
インフラエンジニアのためのcassandra入門インフラエンジニアのためのcassandra入門
インフラエンジニアのためのcassandra入門
 
Kafka・Storm・ZooKeeperの認証と認可について #kafkajp
Kafka・Storm・ZooKeeperの認証と認可について #kafkajpKafka・Storm・ZooKeeperの認証と認可について #kafkajp
Kafka・Storm・ZooKeeperの認証と認可について #kafkajp
 
Apache HBase 入門 (第1回)
Apache HBase 入門 (第1回)Apache HBase 入門 (第1回)
Apache HBase 入門 (第1回)
 
BigQuery walk through.pptx
BigQuery walk through.pptxBigQuery walk through.pptx
BigQuery walk through.pptx
 
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
 
20191115-PGconf.Japan
20191115-PGconf.Japan20191115-PGconf.Japan
20191115-PGconf.Japan
 
Beyond SQL: Speeding up Spark with DataFrames
Beyond SQL: Speeding up Spark with DataFramesBeyond SQL: Speeding up Spark with DataFrames
Beyond SQL: Speeding up Spark with DataFrames
 
[GKE & Spanner 勉強会] Cloud Spanner の技術概要
[GKE & Spanner 勉強会] Cloud Spanner の技術概要[GKE & Spanner 勉強会] Cloud Spanner の技術概要
[GKE & Spanner 勉強会] Cloud Spanner の技術概要
 
IoTデバイスデータ収集の難しい点
IoTデバイスデータ収集の難しい点IoTデバイスデータ収集の難しい点
IoTデバイスデータ収集の難しい点
 
Kafkaを活用するためのストリーム処理の基本
Kafkaを活用するためのストリーム処理の基本Kafkaを活用するためのストリーム処理の基本
Kafkaを活用するためのストリーム処理の基本
 
How Dashtable Helps Dragonfly Maintain Low Latency
How Dashtable Helps Dragonfly Maintain Low LatencyHow Dashtable Helps Dragonfly Maintain Low Latency
How Dashtable Helps Dragonfly Maintain Low Latency
 
dbt 101
dbt 101dbt 101
dbt 101
 
At least onceってぶっちゃけ問題の先送りだったよね #kafkajp
At least onceってぶっちゃけ問題の先送りだったよね #kafkajpAt least onceってぶっちゃけ問題の先送りだったよね #kafkajp
At least onceってぶっちゃけ問題の先送りだったよね #kafkajp
 
Hadoop et son écosystème - v2
Hadoop et son écosystème - v2Hadoop et son écosystème - v2
Hadoop et son écosystème - v2
 

Similar to GraphQL & DGraph with Go

GraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxGraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptx
Soham Dasgupta
 
GraphQL And Relay Modern
GraphQL And Relay ModernGraphQL And Relay Modern
GraphQL And Relay Modern
Brad Pillow
 
GraphQL and Relay Modern
GraphQL and Relay ModernGraphQL and Relay Modern
GraphQL and Relay Modern
Carmel JavaScript Roundabout
 
GraphQL And Relay Modern
GraphQL And Relay ModernGraphQL And Relay Modern
GraphQL And Relay Modern
Brad Pillow
 
GraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database accessGraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database access
Connected Data World
 
Neo4j Morpheus: Interweaving Table and Graph Data with SQL and Cypher in Apac...
Neo4j Morpheus: Interweaving Table and Graph Data with SQL and Cypher in Apac...Neo4j Morpheus: Interweaving Table and Graph Data with SQL and Cypher in Apac...
Neo4j Morpheus: Interweaving Table and Graph Data with SQL and Cypher in Apac...
Databricks
 
GraphQL & Prisma from Scratch
GraphQL & Prisma from ScratchGraphQL & Prisma from Scratch
GraphQL & Prisma from Scratch
Nikolas Burk
 
GraphQL-ify your API - JFall 2022
GraphQL-ify your API - JFall 2022GraphQL-ify your API - JFall 2022
GraphQL-ify your API - JFall 2022
Soham Dasgupta
 
GraphQL IndyJS April 2016
GraphQL IndyJS April 2016GraphQL IndyJS April 2016
GraphQL IndyJS April 2016
Brad Pillow
 
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
Spark Summit
 
ScalaTo July 2019 - No more struggles with Apache Spark workloads in production
ScalaTo July 2019 - No more struggles with Apache Spark workloads in productionScalaTo July 2019 - No more struggles with Apache Spark workloads in production
ScalaTo July 2019 - No more struggles with Apache Spark workloads in production
Chetan Khatri
 
GraphQL-ify your APIs
GraphQL-ify your APIsGraphQL-ify your APIs
GraphQL-ify your APIs
Soham Dasgupta
 
GraphQL + relay
GraphQL + relayGraphQL + relay
GraphQL + relay
Cédric GILLET
 
Scrap Your MapReduce - Apache Spark
 Scrap Your MapReduce - Apache Spark Scrap Your MapReduce - Apache Spark
Scrap Your MapReduce - Apache Spark
IndicThreads
 
GraphQL
GraphQLGraphQL
Cascading on starfish
Cascading on starfishCascading on starfish
Cascading on starfish
Fei Dong
 
Graphql usage
Graphql usageGraphql usage
Graphql usage
Valentin Buryakov
 
Code-first GraphQL Server Development with Prisma
Code-first  GraphQL Server Development with PrismaCode-first  GraphQL Server Development with Prisma
Code-first GraphQL Server Development with Prisma
Nikolas Burk
 
GraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits togetherGraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits together
Sashko Stubailo
 
GraphQL API Gateway and microservices
GraphQL API Gateway and microservicesGraphQL API Gateway and microservices
GraphQL API Gateway and microservices
Mohammed Shaban
 

Similar to GraphQL & DGraph with Go (20)

GraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptxGraphQL_devoxx_2023.pptx
GraphQL_devoxx_2023.pptx
 
GraphQL And Relay Modern
GraphQL And Relay ModernGraphQL And Relay Modern
GraphQL And Relay Modern
 
GraphQL and Relay Modern
GraphQL and Relay ModernGraphQL and Relay Modern
GraphQL and Relay Modern
 
GraphQL And Relay Modern
GraphQL And Relay ModernGraphQL And Relay Modern
GraphQL And Relay Modern
 
GraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database accessGraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database access
 
Neo4j Morpheus: Interweaving Table and Graph Data with SQL and Cypher in Apac...
Neo4j Morpheus: Interweaving Table and Graph Data with SQL and Cypher in Apac...Neo4j Morpheus: Interweaving Table and Graph Data with SQL and Cypher in Apac...
Neo4j Morpheus: Interweaving Table and Graph Data with SQL and Cypher in Apac...
 
GraphQL & Prisma from Scratch
GraphQL & Prisma from ScratchGraphQL & Prisma from Scratch
GraphQL & Prisma from Scratch
 
GraphQL-ify your API - JFall 2022
GraphQL-ify your API - JFall 2022GraphQL-ify your API - JFall 2022
GraphQL-ify your API - JFall 2022
 
GraphQL IndyJS April 2016
GraphQL IndyJS April 2016GraphQL IndyJS April 2016
GraphQL IndyJS April 2016
 
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
Advanced Data Science with Apache Spark-(Reza Zadeh, Stanford)
 
ScalaTo July 2019 - No more struggles with Apache Spark workloads in production
ScalaTo July 2019 - No more struggles with Apache Spark workloads in productionScalaTo July 2019 - No more struggles with Apache Spark workloads in production
ScalaTo July 2019 - No more struggles with Apache Spark workloads in production
 
GraphQL-ify your APIs
GraphQL-ify your APIsGraphQL-ify your APIs
GraphQL-ify your APIs
 
GraphQL + relay
GraphQL + relayGraphQL + relay
GraphQL + relay
 
Scrap Your MapReduce - Apache Spark
 Scrap Your MapReduce - Apache Spark Scrap Your MapReduce - Apache Spark
Scrap Your MapReduce - Apache Spark
 
GraphQL
GraphQLGraphQL
GraphQL
 
Cascading on starfish
Cascading on starfishCascading on starfish
Cascading on starfish
 
Graphql usage
Graphql usageGraphql usage
Graphql usage
 
Code-first GraphQL Server Development with Prisma
Code-first  GraphQL Server Development with PrismaCode-first  GraphQL Server Development with Prisma
Code-first GraphQL Server Development with Prisma
 
GraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits togetherGraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits together
 
GraphQL API Gateway and microservices
GraphQL API Gateway and microservicesGraphQL API Gateway and microservices
GraphQL API Gateway and microservices
 

Recently uploaded

Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Bert Blevins
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
Aurora Consulting
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Erasmo Purificato
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 

Recently uploaded (20)

Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 

GraphQL & DGraph with Go

  • 1. GraphQL & DGraph with GO 1
  • 2. James tan @ Okestra Systems Sdn Bhd | https://okestra.co/ | james@okestra.co | 0123221812 2 Workflow management simplified Let’s make GO fun! With AI (soon)
  • 3. What is GraphQL? GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. 3
  • 4. Who uses GraphQL? 4 And more @ https://graphql.org/users/
  • 5. Trusty REST GET, POST, HEAD, DELETE, OPTIONS, PUT, TRACE, CONNECT GET /pages GET /pages/5 POST /pages PUT /pages/5 DELETE /pages/5 Examples: 5
  • 7. Multiple Round Trip 7 ● fetch /pages/1 ● fetch /comments?pageID=1 ● fetch /users/2 query page($id: Int) { page(ID: $id) { title description comments { id message created_by { id name } } } } REST: GraphQL:
  • 8. Multiple Round Trip 8 ● fetch /pages/1 ● fetch /comments?pageID=1 ● fetch /users/2 query page($id: Int) { page(ID: $id) { title description comments { id message created_by { id name } } } announcements() { edges { node: { id title message } } } REST: GraphQL:
  • 9. Over fetching data 9 ● Frontend: fetch /pages ● Admin: fetch /pages Frontend: Admin: title date description title date description ... ID title Created by Created on Published 1 Title here ... ... Yes 2 comments 5 comments [ { id: 1, title: “title”, description: “...”, created_at: “...”, created_by: { name: “...” }, Comments_count: 2 }, … ] REST Frontend & admin:
  • 10. Over fetching data 10 Frontend: Admin: title date description title date description ... ID title Created by Created on Published 1 Title here ... ... Yes 2 comments 5 comments query page($id: Int) { page(ID: $id) { title description Comment_count … }} GraphQL frontend: query page($id: Int) { page(ID: $id) { Title … }} GraphQL admin:
  • 11. Schema Documentation 11 Allow API Discovery and exploration REST: schema { query: Query mutation: Mutation } type Query { user(email: String!): User users(first: Int, after: String): UsersConnection! } type Mutation { createUser(email: String!, password: String!): User }
  • 12. Implementing GraphQL ● graphql-go: An implementation of GraphQL for Go / Golang. ● graph-gophers/graphql-go: An active implementation of GraphQL in Golang (was https://github.com/graph-gophers/graphql-go). ● GQLGen - Go generate based graphql server library. ● graphql-relay-go: A Go/Golang library to help construct a graphql-go server supporting react-relay. ● machinebox/graphql: An elegant low-level HTTP client for GraphQL. ● samsarahq/thunder: A GraphQL implementation with easy schema building, live queries, and batching 12 https://graphql.org/code/#go
  • 13. Graphql-go ● minimal API ● support for context.Context ● support for the OpenTracing standard ● schema type-checking against resolvers ● resolvers are matched to the schema based on method sets (can resolve a GraphQL schema with a Go interface or Go struct). ● handles panics in resolvers ● parallel execution of resolvers ● Subscriptions https://github.com/graph-gophers/graphql-go 13
  • 14. Setup graphqlSchema := graphql.MustParseSchema(schema.GetRootSchema(), &resolver.Resolver{}) http.Handle("/graphql", h.AddContext(ctx, graphqlupload.Handler( &h.GraphQL{Schema: graphqlSchema}, ), )) Endpoint: https://yourdomain.com/graphql https://github.com/u007/gographqlstart - sample source code 14
  • 16. 16
  • 17. How it works 17 http.Handle Schema.Exec Query resolver Mutation resolver Model resolver Return Query resolver Mutation resolver
  • 18. Query & Mutation example ● Query - query list / single object ● Mutation - update, delete, create ● Subscription - subscribe to update or event https://github.com/u007/gographqlstart/blob/master/resolver/user_query.go https://github.com/u007/gographqlstart/blob/master/resolver/user_mutation.go 18
  • 24. What is DGraph? 24 Dgraph is a distributed, low-latency, high throughput graph database, written in Go. It puts a lot of emphasis on good design, concurrency and minimizing network calls required to execute a query in a distributed environment. Why build Dgraph? We think graph databases are currently second class citizens. They are not considered mature enough to be run as the sole database, and get run alongside other SQL/NoSQL databases. Also, we’re not happy with the design decisions of existing graph databases, which are either non-native or non-distributed, don’t manage underlying data or suffer from performance issues. Is Dgraph production ready? We recommend Dgraph to be used in production at companies. https://dgraph.io/
  • 26. What is Graph database? 26 What is Graph? A graph is composed of two elements: a node and a relationship. Each node represents an entity (a person, place, thing, category or other piece of data), and each relationship represents how two nodes are associated. This general-purpose structure allows you to model all kinds of scenarios – from a system of roads, to a network of devices, to a population’s medical history or anything else defined by relationships. source: https://neo4j.com/why-graph-databases/
  • 27. What is Graph database? 27 A graph database is an online database management system with Create, Read, Update and Delete (CRUD) operations working on a graph data model. source: https://neo4j.com/why-graph-databases/
  • 28. Why Graph database? 28source: https://neo4j.com/why-graph-databases/
  • 29. Performance Example SQL with “Join”s SELECT 'paper_review'::text AS type, paper_reviews.id, paper_reviews.user_id, concat_ws(' '::text, users.first_name, users.last_name) AS user_full_name, users.title AS user_title, users.photo AS user_photo, users.organization AS user_organization, users.username, paper_reviews.paper_id, NULL::character varying AS language_framework, NULL::text AS performance_description, paper_reviews.score_tech, paper_reviews.score_original, ( SELECT count(comments.id) AS count FROM public.comments WHERE ((comments.source_id = paper_reviews.id) AND (comments.vote = 1))) AS likes_count, ( SELECT count(comments.id) AS count FROM public.comments WHERE ((comments.source_id = paper_reviews.id) AND (comments.vote = 0))) AS comments_count FROM ((public.paper_reviews LEFT JOIN public.papers ON ((paper_reviews.paper_id = papers.id))) LEFT JOIN public.users ON ((paper_reviews.user_id = users.id))) UNION SELECT 'paper_code'::text AS type, paper_codes.id, paper_codes.user_id, concat_ws(' '::text, users.first_name, users.last_name) AS user_full_name, users.title AS user_title, ... Why Graph database? 29
  • 30. Performance NoSQL Multiple round trip to database server GraphDB Single Query with additional relation mapping Why Graph database? 30
  • 31. Flexibility SQL based: More joins!, more indexing, more optimisations, more group by OR more sub select, or refactor NoSQL based: More round trip for additional collection, more indexing GraphDB Add relation, add to graphql query, more indexing (for non relation field) Why Graph database? 31
  • 32. Agility Flexible schema, alike nosql Add more nodes to distribute queries (dgraph - distributed) Why Graph database? 32
  • 33. DGraph Setup ● Zero node: controls the Dgraph cluster, assigns servers to a group and re-balances data between server groups ● Alpha node: hosts predicates and indexes ● Ratel: UI to run queries, mutations & altering schema (alike pgadmin) https://docs.dgraph.io/get-started/ https://tour.dgraph.io/intro/1/ https://gist.github.com/u007/f47f9e42ae4f7a94b29c542955d698bc - docker-compose example 33
  • 34. DGraph: Declaring schema name: string @index(term) @lang . age: int @index(int) . friend: uid @count @reverse . https://tour.dgraph.io/basic/3/ - data types https://docs.dgraph.io/query-language/#schema-types https://docs.dgraph.io/query-language/#indexing 34
  • 35. DGraph: GO Client go get -u -v github.com/dgraph-io/dgo --- conn, err := grpc.Dial("localhost:9080", grpc.WithInsecure()) if err != nil { log.Fatal(err) } defer conn.Close() dgraphClient := dgo.NewDgraphClient(api.NewDgraphClient(conn)) op := &api.Operation{ Schema: `name: string @index(exact) . age: int @index(int) .`, } err := dgraphClient.Alter(ctx, op) 35
  • 36. DGraph: Updating/Deleting/Mutate txn := dgraphClient.NewTxn() defer txn.Discard(ctx) type Person struct { Uid string `json:"uid,omitempty"` Name string `json:"name,omitempty"` } p := Person{ Uid: "_:alice",//optional Name: "Alice", } 36 pb, err := json.Marshal(p) if err != nil { log.Fatal(err) } mu := &api.Mutation{ SetJson: pb, } assigned, err := txn.Mutate(ctx, mu) if err != nil { log.Fatal(err) }
  • 37. DGraph: Committing transaction / discard txn := dgraphClient.NewTxn() defer txn.Discard(ctx) err := txn.Commit(ctx) if err == y.ErrAborted { // Retry or handle error } 37
  • 38. DGraph: Query Single object q := `query all($a: string) { all(func: eq(name, $a)) { name } }` resp, err := txn.QueryWithVars(ctx, q, map[string]string{"$a": "Alice"}) fmt.Println(string(resp.Json)) { user(func: uid(0xc351)) { First_name Last_name Email roles: with_role { Uid Name } } } 38
  • 39. DGraph: Query list users(func: eq(_type, "users"), first: 10, offset:0, orderdesc: created_at) @filter(has(with_role)) { uid email first_name company : work_for { uid code name } } } 39
  • 41. Me want more... ● https://github.com/graph-gophers/graphql-go ● https://graphql.org/learn/ ● https://docs.dgraph.io/get-started/ ● DGraph quick start: https://gist.github.com/u007/5f68d68d9ee5ad30a10b92ed932b1639 41

Editor's Notes

  1. Can be called via rest post call