SlideShare a Scribd company logo
1 of 30
Download to read offline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Best Practices in designing
GraphQL APIs that scale
Nader Dabit
Developer Advocate
AWS Mobile
M O B 4 2 0
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Think in Graphs
Model your business domain as
a graph
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thinking in Graphs
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Authorization &
Fine-grained Access Control
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Traditional GraphQL API
todoItem = {
type: TodoItemType,
args: { id: { type: GraphQLID } },
resolve: (identity, {id}) => TodoItem.get(identity, id)
};
class TodoItem {
get(identity, id) {
// implementation
}
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS AppSync
{
"version" : "2017-02-28",
"operation" : "Query",
"index" : "author-index",
"query" : {
"expression": "author = :author",
"expressionValues" : {
":author" : {
"S": "${ctx.identity.sub}"
}
}
}
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Naming Matters
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use Input Types
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Input Types
createUser(name: String!, address: String!, age: Int, address: String, gender: String):User
input CreateUserInput {
name: String!
address: String!
age: Int
address: String
gender: String
}
createUser(input: CreateUserInput):User
Without Input type
With Input type
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
API Gateway
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
API Gateway - Resolvers
Interesting use cases
Microservices
Dynamic delivery of image assets for AR / VR applications
Interacting with AI / ML services via a Lambda function
Turning an existing REST API into a GraphQL API
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Efficiency
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Reduce round trips to the backend
{
users {
name
city
friends(first: 10) {
name
}
}
}
GET:1
GET: friends: 1 : 10
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Writing your own API?
Use DataLoader by Facebook
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS AppSync - Batch Operations
#set($ids = [])
#foreach($id in ${ctx.args.ids})
#set($map = {})
$util.qr($map.put("id", $util.dynamodb.toString($id)))
$util.qr($ids.add($map))
#end
{
"operation" : "BatchGetItem",
"tables" : {
"Posts": { "keys": $util.toJson($ids) }
}
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Design for the future
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GraphQL VS REST
Rest GraphQL
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Nader Dabit
@dabit3
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

More Related Content

What's hot

Going Graph With Amazon Neptune - AWS Summit Sydney 2018
Going Graph With Amazon Neptune - AWS Summit Sydney 2018Going Graph With Amazon Neptune - AWS Summit Sydney 2018
Going Graph With Amazon Neptune - AWS Summit Sydney 2018Amazon Web Services
 
Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...
Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...
Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...Amazon Web Services
 
Build Intelligent Apps with Amazon ML
Build Intelligent Apps with Amazon ML Build Intelligent Apps with Amazon ML
Build Intelligent Apps with Amazon ML Amazon Web Services
 
Improve Accessibility Using Machine Learning (AIM332) - AWS re:Invent 2018
Improve Accessibility Using Machine Learning (AIM332) - AWS re:Invent 2018Improve Accessibility Using Machine Learning (AIM332) - AWS re:Invent 2018
Improve Accessibility Using Machine Learning (AIM332) - AWS re:Invent 2018Amazon Web Services
 
Create an ML Factory in Financial Services with CI CD - FSI301 - New York AWS...
Create an ML Factory in Financial Services with CI CD - FSI301 - New York AWS...Create an ML Factory in Financial Services with CI CD - FSI301 - New York AWS...
Create an ML Factory in Financial Services with CI CD - FSI301 - New York AWS...Amazon Web Services
 
Go Global with Cloud-Native Architecture: Deploy AdTech Services Across Four ...
Go Global with Cloud-Native Architecture: Deploy AdTech Services Across Four ...Go Global with Cloud-Native Architecture: Deploy AdTech Services Across Four ...
Go Global with Cloud-Native Architecture: Deploy AdTech Services Across Four ...Amazon Web Services
 
Financial Svcs: Mine Actionable Insights from Customer Interactions Using Mac...
Financial Svcs: Mine Actionable Insights from Customer Interactions Using Mac...Financial Svcs: Mine Actionable Insights from Customer Interactions Using Mac...
Financial Svcs: Mine Actionable Insights from Customer Interactions Using Mac...Amazon Web Services
 
AWS Startup Day Kyiv - AI/ML services for developers
AWS Startup Day Kyiv - AI/ML services for developersAWS Startup Day Kyiv - AI/ML services for developers
AWS Startup Day Kyiv - AI/ML services for developersAmazon Web Services
 
Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018
Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018
Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018Amazon Web Services
 
Using Apache Flink with Amazon Kinesis (ANT395) - AWS re:Invent 2018
Using Apache Flink with Amazon Kinesis (ANT395) - AWS re:Invent 2018Using Apache Flink with Amazon Kinesis (ANT395) - AWS re:Invent 2018
Using Apache Flink with Amazon Kinesis (ANT395) - AWS re:Invent 2018Amazon Web Services
 
M&E Leadership Session: The State of the Industry, What's New from AWS for M&...
M&E Leadership Session: The State of the Industry, What's New from AWS for M&...M&E Leadership Session: The State of the Industry, What's New from AWS for M&...
M&E Leadership Session: The State of the Industry, What's New from AWS for M&...Amazon Web Services
 
Serverless Stream Processing Tips & Tricks (ANT358) - AWS re:Invent 2018
Serverless Stream Processing Tips & Tricks (ANT358) - AWS re:Invent 2018Serverless Stream Processing Tips & Tricks (ANT358) - AWS re:Invent 2018
Serverless Stream Processing Tips & Tricks (ANT358) - AWS re:Invent 2018Amazon Web Services
 
Supercell – Scaling Mobile Games (GAM301) - AWS re:Invent 2018
Supercell – Scaling Mobile Games (GAM301) - AWS re:Invent 2018Supercell – Scaling Mobile Games (GAM301) - AWS re:Invent 2018
Supercell – Scaling Mobile Games (GAM301) - AWS re:Invent 2018Amazon Web Services
 
Analyze Amazon CloudFront and Lambda@Edge Logs to Improve Customer Experience...
Analyze Amazon CloudFront and Lambda@Edge Logs to Improve Customer Experience...Analyze Amazon CloudFront and Lambda@Edge Logs to Improve Customer Experience...
Analyze Amazon CloudFront and Lambda@Edge Logs to Improve Customer Experience...Amazon Web Services
 
Hollywood's Cloud-Based Content Lakes: Modernized Media Archives (MAE203) - A...
Hollywood's Cloud-Based Content Lakes: Modernized Media Archives (MAE203) - A...Hollywood's Cloud-Based Content Lakes: Modernized Media Archives (MAE203) - A...
Hollywood's Cloud-Based Content Lakes: Modernized Media Archives (MAE203) - A...Amazon Web Services
 
Migrating to Amazon Neptune (DAT338) - AWS re:Invent 2018
Migrating to Amazon Neptune (DAT338) - AWS re:Invent 2018Migrating to Amazon Neptune (DAT338) - AWS re:Invent 2018
Migrating to Amazon Neptune (DAT338) - AWS re:Invent 2018Amazon Web Services
 
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdf
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdfMonetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdf
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdfAmazon Web Services
 
How Cox Automotive Runs GitHub Enterprise on AWS (ENT356-S) - AWS re:Invent 2018
How Cox Automotive Runs GitHub Enterprise on AWS (ENT356-S) - AWS re:Invent 2018How Cox Automotive Runs GitHub Enterprise on AWS (ENT356-S) - AWS re:Invent 2018
How Cox Automotive Runs GitHub Enterprise on AWS (ENT356-S) - AWS re:Invent 2018Amazon Web Services
 
Deep Dive on Amazon Neptune - AWS Online Tech Talks
Deep Dive on Amazon Neptune - AWS Online Tech TalksDeep Dive on Amazon Neptune - AWS Online Tech Talks
Deep Dive on Amazon Neptune - AWS Online Tech TalksAmazon Web Services
 
Access Control in AWS Glue Data Catalog (ANT376) - AWS re:Invent 2018
Access Control in AWS Glue Data Catalog (ANT376) - AWS re:Invent 2018Access Control in AWS Glue Data Catalog (ANT376) - AWS re:Invent 2018
Access Control in AWS Glue Data Catalog (ANT376) - AWS re:Invent 2018Amazon Web Services
 

What's hot (20)

Going Graph With Amazon Neptune - AWS Summit Sydney 2018
Going Graph With Amazon Neptune - AWS Summit Sydney 2018Going Graph With Amazon Neptune - AWS Summit Sydney 2018
Going Graph With Amazon Neptune - AWS Summit Sydney 2018
 
Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...
Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...
Search Your DynamoDB Data with Amazon Elasticsearch Service (ANT302) - AWS re...
 
Build Intelligent Apps with Amazon ML
Build Intelligent Apps with Amazon ML Build Intelligent Apps with Amazon ML
Build Intelligent Apps with Amazon ML
 
Improve Accessibility Using Machine Learning (AIM332) - AWS re:Invent 2018
Improve Accessibility Using Machine Learning (AIM332) - AWS re:Invent 2018Improve Accessibility Using Machine Learning (AIM332) - AWS re:Invent 2018
Improve Accessibility Using Machine Learning (AIM332) - AWS re:Invent 2018
 
Create an ML Factory in Financial Services with CI CD - FSI301 - New York AWS...
Create an ML Factory in Financial Services with CI CD - FSI301 - New York AWS...Create an ML Factory in Financial Services with CI CD - FSI301 - New York AWS...
Create an ML Factory in Financial Services with CI CD - FSI301 - New York AWS...
 
Go Global with Cloud-Native Architecture: Deploy AdTech Services Across Four ...
Go Global with Cloud-Native Architecture: Deploy AdTech Services Across Four ...Go Global with Cloud-Native Architecture: Deploy AdTech Services Across Four ...
Go Global with Cloud-Native Architecture: Deploy AdTech Services Across Four ...
 
Financial Svcs: Mine Actionable Insights from Customer Interactions Using Mac...
Financial Svcs: Mine Actionable Insights from Customer Interactions Using Mac...Financial Svcs: Mine Actionable Insights from Customer Interactions Using Mac...
Financial Svcs: Mine Actionable Insights from Customer Interactions Using Mac...
 
AWS Startup Day Kyiv - AI/ML services for developers
AWS Startup Day Kyiv - AI/ML services for developersAWS Startup Day Kyiv - AI/ML services for developers
AWS Startup Day Kyiv - AI/ML services for developers
 
Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018
Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018
Don’t Wait Until Tomorrow: From Batch to Streaming (ANT360) - AWS re:Invent 2018
 
Using Apache Flink with Amazon Kinesis (ANT395) - AWS re:Invent 2018
Using Apache Flink with Amazon Kinesis (ANT395) - AWS re:Invent 2018Using Apache Flink with Amazon Kinesis (ANT395) - AWS re:Invent 2018
Using Apache Flink with Amazon Kinesis (ANT395) - AWS re:Invent 2018
 
M&E Leadership Session: The State of the Industry, What's New from AWS for M&...
M&E Leadership Session: The State of the Industry, What's New from AWS for M&...M&E Leadership Session: The State of the Industry, What's New from AWS for M&...
M&E Leadership Session: The State of the Industry, What's New from AWS for M&...
 
Serverless Stream Processing Tips & Tricks (ANT358) - AWS re:Invent 2018
Serverless Stream Processing Tips & Tricks (ANT358) - AWS re:Invent 2018Serverless Stream Processing Tips & Tricks (ANT358) - AWS re:Invent 2018
Serverless Stream Processing Tips & Tricks (ANT358) - AWS re:Invent 2018
 
Supercell – Scaling Mobile Games (GAM301) - AWS re:Invent 2018
Supercell – Scaling Mobile Games (GAM301) - AWS re:Invent 2018Supercell – Scaling Mobile Games (GAM301) - AWS re:Invent 2018
Supercell – Scaling Mobile Games (GAM301) - AWS re:Invent 2018
 
Analyze Amazon CloudFront and Lambda@Edge Logs to Improve Customer Experience...
Analyze Amazon CloudFront and Lambda@Edge Logs to Improve Customer Experience...Analyze Amazon CloudFront and Lambda@Edge Logs to Improve Customer Experience...
Analyze Amazon CloudFront and Lambda@Edge Logs to Improve Customer Experience...
 
Hollywood's Cloud-Based Content Lakes: Modernized Media Archives (MAE203) - A...
Hollywood's Cloud-Based Content Lakes: Modernized Media Archives (MAE203) - A...Hollywood's Cloud-Based Content Lakes: Modernized Media Archives (MAE203) - A...
Hollywood's Cloud-Based Content Lakes: Modernized Media Archives (MAE203) - A...
 
Migrating to Amazon Neptune (DAT338) - AWS re:Invent 2018
Migrating to Amazon Neptune (DAT338) - AWS re:Invent 2018Migrating to Amazon Neptune (DAT338) - AWS re:Invent 2018
Migrating to Amazon Neptune (DAT338) - AWS re:Invent 2018
 
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdf
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdfMonetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdf
Monetize Your Mobile App with Amazon Mobile Ads (MOB311) - AWS reInvent 2018.pdf
 
How Cox Automotive Runs GitHub Enterprise on AWS (ENT356-S) - AWS re:Invent 2018
How Cox Automotive Runs GitHub Enterprise on AWS (ENT356-S) - AWS re:Invent 2018How Cox Automotive Runs GitHub Enterprise on AWS (ENT356-S) - AWS re:Invent 2018
How Cox Automotive Runs GitHub Enterprise on AWS (ENT356-S) - AWS re:Invent 2018
 
Deep Dive on Amazon Neptune - AWS Online Tech Talks
Deep Dive on Amazon Neptune - AWS Online Tech TalksDeep Dive on Amazon Neptune - AWS Online Tech Talks
Deep Dive on Amazon Neptune - AWS Online Tech Talks
 
Access Control in AWS Glue Data Catalog (ANT376) - AWS re:Invent 2018
Access Control in AWS Glue Data Catalog (ANT376) - AWS re:Invent 2018Access Control in AWS Glue Data Catalog (ANT376) - AWS re:Invent 2018
Access Control in AWS Glue Data Catalog (ANT376) - AWS re:Invent 2018
 

Similar to Best Practices for Designing GraphQL APIs That Scale (MOB420-R1) - AWS re:Invent 2018

Leadership Session: Developing Mobile & Web Apps on AWS (MOB202-L) - AWS re:I...
Leadership Session: Developing Mobile & Web Apps on AWS (MOB202-L) - AWS re:I...Leadership Session: Developing Mobile & Web Apps on AWS (MOB202-L) - AWS re:I...
Leadership Session: Developing Mobile & Web Apps on AWS (MOB202-L) - AWS re:I...Amazon Web Services
 
Taking your Progressive Web App to the Next Level - AWS Summit Sydney 2018
Taking your Progressive Web App to the Next Level - AWS Summit Sydney 2018Taking your Progressive Web App to the Next Level - AWS Summit Sydney 2018
Taking your Progressive Web App to the Next Level - AWS Summit Sydney 2018Amazon Web Services
 
Build your APPs in Lean and Agile Way using AWS Amplify
Build your APPs in Lean and Agile Way using AWS AmplifyBuild your APPs in Lean and Agile Way using AWS Amplify
Build your APPs in Lean and Agile Way using AWS AmplifyAmazon Web Services
 
善用 GraphQL 與 AWS AppSync 讓您的 Progressive Web App (PWA) 加速進化 (Level 200)
善用  GraphQL 與 AWS AppSync 讓您的  Progressive Web App (PWA) 加速進化 (Level 200)善用  GraphQL 與 AWS AppSync 讓您的  Progressive Web App (PWA) 加速進化 (Level 200)
善用 GraphQL 與 AWS AppSync 讓您的 Progressive Web App (PWA) 加速進化 (Level 200)Amazon Web Services
 
Websites go Serverless | AWS Floor28
Websites go Serverless | AWS Floor28Websites go Serverless | AWS Floor28
Websites go Serverless | AWS Floor28Amazon Web Services
 
Websites go Serverless - Floor28
Websites go Serverless - Floor28Websites go Serverless - Floor28
Websites go Serverless - Floor28Boaz Ziniman
 
Taking your Progressive Web App to the Next Level with GraphQL and AWS AppSync
Taking your Progressive Web App to the Next Level with GraphQL and AWS AppSyncTaking your Progressive Web App to the Next Level with GraphQL and AWS AppSync
Taking your Progressive Web App to the Next Level with GraphQL and AWS AppSyncAmazon Web Services
 
Building Real-Time Serverless Backends with GraphQL
Building Real-Time Serverless Backends with GraphQLBuilding Real-Time Serverless Backends with GraphQL
Building Real-Time Serverless Backends with GraphQLAmazon Web Services
 
Using AI for real-life data enrichment - Tel Aviv Summit 2018
Using AI for real-life data enrichment - Tel Aviv Summit 2018Using AI for real-life data enrichment - Tel Aviv Summit 2018
Using AI for real-life data enrichment - Tel Aviv Summit 2018Amazon Web Services
 
「リモートペアプロでマントルを突き抜けろ!」AWS Cloud9でリモートペアプロ&楽々サーバーレス開発
「リモートペアプロでマントルを突き抜けろ!」AWS Cloud9でリモートペアプロ&楽々サーバーレス開発「リモートペアプロでマントルを突き抜けろ!」AWS Cloud9でリモートペアプロ&楽々サーバーレス開発
「リモートペアプロでマントルを突き抜けろ!」AWS Cloud9でリモートペアプロ&楽々サーバーレス開発Atsushi Fukui
 
Building your first GraphQL API with AWS AppSync
Building your first GraphQL API with AWS AppSyncBuilding your first GraphQL API with AWS AppSync
Building your first GraphQL API with AWS AppSyncAmazon Web Services
 
Building your First GraphQL API with AWS AppSync
Building your First GraphQL API with AWS AppSyncBuilding your First GraphQL API with AWS AppSync
Building your First GraphQL API with AWS AppSyncAmazon Web Services
 
Nader Dabit - Intro to AWS AppSync.pdf
Nader Dabit - Intro to AWS AppSync.pdfNader Dabit - Intro to AWS AppSync.pdf
Nader Dabit - Intro to AWS AppSync.pdfAmazon Web Services
 
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...Codemotion
 
Building mobile apps that can automatically scale globally to millions of use...
Building mobile apps that can automatically scale globally to millions of use...Building mobile apps that can automatically scale globally to millions of use...
Building mobile apps that can automatically scale globally to millions of use...AWS Germany
 
Provide Faster, Scalable Solutions to Support Research Use Cases with AWS (WP...
Provide Faster, Scalable Solutions to Support Research Use Cases with AWS (WP...Provide Faster, Scalable Solutions to Support Research Use Cases with AWS (WP...
Provide Faster, Scalable Solutions to Support Research Use Cases with AWS (WP...Amazon Web Services
 
Gaining Visibility and Insight into Your Distributed Applications with AWS X-...
Gaining Visibility and Insight into Your Distributed Applications with AWS X-...Gaining Visibility and Insight into Your Distributed Applications with AWS X-...
Gaining Visibility and Insight into Your Distributed Applications with AWS X-...Amazon Web Services
 
Build a Photo-Sharing App with AI-Powered Face and Object Detection (MOB306) ...
Build a Photo-Sharing App with AI-Powered Face and Object Detection (MOB306) ...Build a Photo-Sharing App with AI-Powered Face and Object Detection (MOB306) ...
Build a Photo-Sharing App with AI-Powered Face and Object Detection (MOB306) ...Amazon Web Services
 
Building Real-Time Serverless Backends with GraphQL
Building Real-Time Serverless Backends with GraphQLBuilding Real-Time Serverless Backends with GraphQL
Building Real-Time Serverless Backends with GraphQLAmazon Web Services
 
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...Codemotion
 

Similar to Best Practices for Designing GraphQL APIs That Scale (MOB420-R1) - AWS re:Invent 2018 (20)

Leadership Session: Developing Mobile & Web Apps on AWS (MOB202-L) - AWS re:I...
Leadership Session: Developing Mobile & Web Apps on AWS (MOB202-L) - AWS re:I...Leadership Session: Developing Mobile & Web Apps on AWS (MOB202-L) - AWS re:I...
Leadership Session: Developing Mobile & Web Apps on AWS (MOB202-L) - AWS re:I...
 
Taking your Progressive Web App to the Next Level - AWS Summit Sydney 2018
Taking your Progressive Web App to the Next Level - AWS Summit Sydney 2018Taking your Progressive Web App to the Next Level - AWS Summit Sydney 2018
Taking your Progressive Web App to the Next Level - AWS Summit Sydney 2018
 
Build your APPs in Lean and Agile Way using AWS Amplify
Build your APPs in Lean and Agile Way using AWS AmplifyBuild your APPs in Lean and Agile Way using AWS Amplify
Build your APPs in Lean and Agile Way using AWS Amplify
 
善用 GraphQL 與 AWS AppSync 讓您的 Progressive Web App (PWA) 加速進化 (Level 200)
善用  GraphQL 與 AWS AppSync 讓您的  Progressive Web App (PWA) 加速進化 (Level 200)善用  GraphQL 與 AWS AppSync 讓您的  Progressive Web App (PWA) 加速進化 (Level 200)
善用 GraphQL 與 AWS AppSync 讓您的 Progressive Web App (PWA) 加速進化 (Level 200)
 
Websites go Serverless | AWS Floor28
Websites go Serverless | AWS Floor28Websites go Serverless | AWS Floor28
Websites go Serverless | AWS Floor28
 
Websites go Serverless - Floor28
Websites go Serverless - Floor28Websites go Serverless - Floor28
Websites go Serverless - Floor28
 
Taking your Progressive Web App to the Next Level with GraphQL and AWS AppSync
Taking your Progressive Web App to the Next Level with GraphQL and AWS AppSyncTaking your Progressive Web App to the Next Level with GraphQL and AWS AppSync
Taking your Progressive Web App to the Next Level with GraphQL and AWS AppSync
 
Building Real-Time Serverless Backends with GraphQL
Building Real-Time Serverless Backends with GraphQLBuilding Real-Time Serverless Backends with GraphQL
Building Real-Time Serverless Backends with GraphQL
 
Using AI for real-life data enrichment - Tel Aviv Summit 2018
Using AI for real-life data enrichment - Tel Aviv Summit 2018Using AI for real-life data enrichment - Tel Aviv Summit 2018
Using AI for real-life data enrichment - Tel Aviv Summit 2018
 
「リモートペアプロでマントルを突き抜けろ!」AWS Cloud9でリモートペアプロ&楽々サーバーレス開発
「リモートペアプロでマントルを突き抜けろ!」AWS Cloud9でリモートペアプロ&楽々サーバーレス開発「リモートペアプロでマントルを突き抜けろ!」AWS Cloud9でリモートペアプロ&楽々サーバーレス開発
「リモートペアプロでマントルを突き抜けろ!」AWS Cloud9でリモートペアプロ&楽々サーバーレス開発
 
Building your first GraphQL API with AWS AppSync
Building your first GraphQL API with AWS AppSyncBuilding your first GraphQL API with AWS AppSync
Building your first GraphQL API with AWS AppSync
 
Building your First GraphQL API with AWS AppSync
Building your First GraphQL API with AWS AppSyncBuilding your First GraphQL API with AWS AppSync
Building your First GraphQL API with AWS AppSync
 
Nader Dabit - Intro to AWS AppSync.pdf
Nader Dabit - Intro to AWS AppSync.pdfNader Dabit - Intro to AWS AppSync.pdf
Nader Dabit - Intro to AWS AppSync.pdf
 
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
 
Building mobile apps that can automatically scale globally to millions of use...
Building mobile apps that can automatically scale globally to millions of use...Building mobile apps that can automatically scale globally to millions of use...
Building mobile apps that can automatically scale globally to millions of use...
 
Provide Faster, Scalable Solutions to Support Research Use Cases with AWS (WP...
Provide Faster, Scalable Solutions to Support Research Use Cases with AWS (WP...Provide Faster, Scalable Solutions to Support Research Use Cases with AWS (WP...
Provide Faster, Scalable Solutions to Support Research Use Cases with AWS (WP...
 
Gaining Visibility and Insight into Your Distributed Applications with AWS X-...
Gaining Visibility and Insight into Your Distributed Applications with AWS X-...Gaining Visibility and Insight into Your Distributed Applications with AWS X-...
Gaining Visibility and Insight into Your Distributed Applications with AWS X-...
 
Build a Photo-Sharing App with AI-Powered Face and Object Detection (MOB306) ...
Build a Photo-Sharing App with AI-Powered Face and Object Detection (MOB306) ...Build a Photo-Sharing App with AI-Powered Face and Object Detection (MOB306) ...
Build a Photo-Sharing App with AI-Powered Face and Object Detection (MOB306) ...
 
Building Real-Time Serverless Backends with GraphQL
Building Real-Time Serverless Backends with GraphQLBuilding Real-Time Serverless Backends with GraphQL
Building Real-Time Serverless Backends with GraphQL
 
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Best Practices for Designing GraphQL APIs That Scale (MOB420-R1) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Best Practices in designing GraphQL APIs that scale Nader Dabit Developer Advocate AWS Mobile M O B 4 2 0
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Think in Graphs Model your business domain as a graph
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thinking in Graphs
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Authorization & Fine-grained Access Control
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Traditional GraphQL API todoItem = { type: TodoItemType, args: { id: { type: GraphQLID } }, resolve: (identity, {id}) => TodoItem.get(identity, id) }; class TodoItem { get(identity, id) { // implementation } }
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS AppSync { "version" : "2017-02-28", "operation" : "Query", "index" : "author-index", "query" : { "expression": "author = :author", "expressionValues" : { ":author" : { "S": "${ctx.identity.sub}" } } } }
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Naming Matters
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Use Input Types
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Input Types createUser(name: String!, address: String!, age: Int, address: String, gender: String):User input CreateUserInput { name: String! address: String! age: Int address: String gender: String } createUser(input: CreateUserInput):User Without Input type With Input type
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. API Gateway
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. API Gateway - Resolvers Interesting use cases Microservices Dynamic delivery of image assets for AR / VR applications Interacting with AI / ML services via a Lambda function Turning an existing REST API into a GraphQL API
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Efficiency
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Reduce round trips to the backend { users { name city friends(first: 10) { name } } } GET:1 GET: friends: 1 : 10
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Writing your own API? Use DataLoader by Facebook
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS AppSync - Batch Operations #set($ids = []) #foreach($id in ${ctx.args.ids}) #set($map = {}) $util.qr($map.put("id", $util.dynamodb.toString($id))) $util.qr($ids.add($map)) #end { "operation" : "BatchGetItem", "tables" : { "Posts": { "keys": $util.toJson($ids) } } }
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Design for the future
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. GraphQL VS REST Rest GraphQL
  • 29. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Nader Dabit @dabit3
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.