SlideShare a Scribd company logo
1 of 47
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Ed Lima – Solutions Architect
July 2018
Taking your Progressive Web App
to the Next Level with
GraphQL and AWS AppSync
@ednergizer
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Digital Media
50%
34%
9%
7%
Mobile App Desktop Mobile Web Tablet App
Time spent
comScore Media Metrix Multi-Platform & Mobile Metrix, U.S., Total Audience, June 2017
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
comScore Media Metrix Multi-Platform & Mobile Metrix, U.S., Total Audience, June 2017
0
5
11
16
21
Unique Visitors
Mobile Web Mobile App
Average Monthly
Unique Visitors
2.2x
Mobile
App
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Progress to Progressive
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Progressive Web Apps (PWA)
Responsive web
application
Defined by
manifest.json
Discoverable and
installable
A Progressive Web App uses
modern web capabilities
to deliver
an app-like user experience
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Why Progressive Web Apps
Secure ShareableNetwork Agnostic Always up-to-date
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Core Components
Application shell Service worker Storage and cache
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Toolchain & Production Scale
• Web framework (Ember.js, Angular.js, Ionic, React, etc.)
• CLI/build system (Workbox, Ionic, Grunt/Gulp, AWS CLI)
• Libraries/utilities (Local Forage, Handlebars)
• Deployment (CloudFront, S3, AWS Mobile CLI, Mobile Hub)
What about the backend?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Traditional Data Fetching
Data
 Trivial to set up
 Standard HTTP Calls
❌ Relationships
❌ Lists with reduced information
❌ Query support
❌ Ordering and pagination
❌ Notifications
/posts
/postInfo
/postJustTitle
/postsByAuthor
/postNameStartsX
/postByTag
/commentsOnPost
REST Endpoints
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Is there a better way
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
GraphQL
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What is GraphQL?
Uniform API across data
stores and APIs
Network optimized
requests and responses
Powerful developer
tools
Integrated documentation
and introspection
Describe what’s possible
with a type system
Query language for your API
and a runtime for fulfilling
queries with existing data
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What Is GraphQL?
/posts /comments /authors
REST API
posts comments authors
GraphQL API
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
query {
getEvent(id: 1){
id
name
}
}
mutation {
createEvent(name:”MeetUp”){
id
}
}
subscription {
onCreateComment {
id
}
}
GraphQL Operations
Queries
Read Data
Mutations
Write Data
Subscriptions
Receive Data in Real-Time
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How to Use GraphQL
type Query {
listEvents: [Event]
}
type Event {
id: ID!
name: String!
when: String!
where: String!
}
query {
listEvents {
id
name
}
}
{
"id": "1",
"name": "React Meet Up"
},
{
"id": "2",
"name": "GraphQL Party"
},
{
“id”: “3”,
“name”: “Angular Sesh”
}
...
Define your data
(Schema)
Invoke Operation Get EXACTLY what
you asked for
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How to Use GraphQL
type Query {
listEvents: [Event]
}
type Event {
id: ID!
name: String!
when: String!
where: String!
}
query {
listEvents {
id
name
when
}
}
{
"id": "1”,
"name": "React Meet Up”,
“when”: “Tomorrow”
},
{
"id": "2",
"name": "GraphQL Party",
“when”: “Saturday”
},
{
“id”: “3”,
“name”: “Angular Sesh”,
“when”: “Next Friday”
}...
Define your data
(Schema)
Invoke Operation Get EXACTLY what
you asked for
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
GraphQL sounds legit!
I want to run my own GraphQL server!!
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Focus on Apps
Not Infrastructure
AWS AppSync
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS AppSync
Managed Serverless GraphQL service Connect to data sources
in your account
Add data sync, real-time and
offline capabilities for any data
source or API
GraphQL façade for any AWS service Conflict detection and
resolution in the cloud
Enterprise security
features (IAM, Cognito,
OIDC, API keys)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AppSync is first and foremost an application data service with
real-time and offline features implemented over GraphQL
with additional capabilities such as built-in authorization and
conflict resolution.
But what is AWS AppSync really?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How does AppSync work?
Create, Import or Upload
GraphQL Schema
Amazon
Elasticsearch
Amazon
DynamoDB
AWS Lambda
Connect Data Sources AppSync Updates Data
in Real Time and Manages
Data when Offline
__________
______________
___________
_________
___________
____________
__________
NEW
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Building data-driven apps with AWS AppSync
Robust, scalable storage
capable of handling
millions of events a day
Geospatial search Real-time updatesMobile and Web
clients
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS AppSync Benefits
Clients receive the data
they ask for. Nothing
more, nothing less
Get many resources from
many data sources with a
single request
Self-documenting APIs with
Introspection
React Native, Android, iOS,
and Web (JS) using the
Apollo GraphQL client
Data persistence across
application restarts
Write-through mutations
with optimistic UI
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Elasticsearch
DynamoDB
Browser
Mobile
device WebSocket
servers
Web servers
PubSub
servers
Subscription
/search
/taps
/taps/:id
/m_search
AWS Lambda
Third-party service
…
Real-Time App before AppSync
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
/graphql
AWS AppSync
Subscription Elasticsearch
DynamoDB
AWS Lambda
Third-party service
Real-Time App after AppSync
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Real-Time Updates
• GraphQL subscriptions
• Event stream of mutation results
• Data synchronization with MQTT + WebSockets
• Client managed WebSocket connection
• Automatic catch-up snapshots
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Conflicts
Jane
Version : 2 Updated Document
Jane
Version : 2 Updated Document
Version : 3 Updated Document
Version : 1 New Document
Time
John
John
Jane goes offline
Jane comes back online
Version : 4 Updated Document
John
Jane
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Handle Data Conflicts in the Cloud
• Conflict detection with optimistic version check.
• Conflict resolution strategies:
A. Client wins
B. Server wins
C. Silent reject
D. Custom logic in AWS Lambda
• Client callback for conflict resolution is available.
"condition" : {
"expression" : "someExpression"
"conditionalCheckFailedHandler" : {
"strategy" : "Custom",
"lambdaArn" : "arn:..."
}
}
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Offline Capabilities - AppSync Client Storage
• Offline is a write-through "Store"
• Persistent storage mediums back the Apollo normalized
cache
• Local Storage for web
• AsyncStorage for React Native
• SQLite on native platforms
• Database can be preloaded
• Offline client can be configured
• WiFi only
• WiFi and cellular
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon API Gateway AWS AppSync
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon API Gateway AWS AppSync
vs
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon API Gateway AWS AppSync
vs
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon API Gateway AWS AppSync
&
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon API Gateway AWS AppSync
&
Enough Talking
https://aws.amazon.com/appsync/resources/#Starter_applications (Angular Chat App)
https://github.com/aws-samples/aws-mobile-appsync-chat-starter-angular
https://aws.amazon.com/blogs/mobile/building-a-serverless-real-time-chat-application-with-aws-appsync/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon
Cognito
User Pools
JWT Token
GraphQL
Schema
ChatQL
Conversations
Table
Messages
Table
User Conversations
Table
Users Table
Amazon
DynamoDB
Queries and Mutations
Subscriptions
AppSync
Resolvers
User
AWS AppSync
AppSync Data Sources
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
User
1..1
1..n
1..1
1..n
1..n
User
Conversation
Conversation Messages
GraphQL Relations between NoSQL DynamoDB Tables
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Demo Time!
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Takeaways
Don’t boil the Ocean.
Start small and iterate
on Offline (cache-and-
network), Real-time
and Conflict
Resolution
Use UI cues with
Optimistic UI when
Offline
Take advantage of
built-in GraphQL
powerful features such
as Connections
(Pagination) and
Relations (NoSQL)
It’s all about the
User Experience:
PWAs + AppSync = 
It’s all about the User Experience !
https://secure.i.telegraph.co.uk/multimedia/archive/02884/babies_2884567b.jpg
Thank you

More Related Content

What's hot

Enable Your Marketing Teams to Engage Users with Relevant & Personalized Cont...
Enable Your Marketing Teams to Engage Users with Relevant & Personalized Cont...Enable Your Marketing Teams to Engage Users with Relevant & Personalized Cont...
Enable Your Marketing Teams to Engage Users with Relevant & Personalized Cont...Amazon 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
 
Websites go Serverless - Floor28
Websites go Serverless - Floor28Websites go Serverless - Floor28
Websites go Serverless - Floor28Boaz Ziniman
 
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
 
BDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMaker
BDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMakerBDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMaker
BDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMakerAmazon 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
 
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
 
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
 
What's New in AR & VR: State of the World Report (ARV203) - AWS re:Invent 2018
What's New in AR & VR: State of the World Report (ARV203) - AWS re:Invent 2018What's New in AR & VR: State of the World Report (ARV203) - AWS re:Invent 2018
What's New in AR & VR: State of the World Report (ARV203) - AWS re:Invent 2018Amazon Web Services
 
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)Amazon Web Services
 
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...Amazon Web Services
 
91APP 之API 經濟學與API Gateway與導入之旅
91APP 之API 經濟學與API Gateway與導入之旅91APP 之API 經濟學與API Gateway與導入之旅
91APP 之API 經濟學與API Gateway與導入之旅Amazon 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
 
Serverless applications with AWS
Serverless applications with AWSServerless applications with AWS
Serverless applications with AWSjavier ramirez
 
How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...
How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...
How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...Amazon Web Services
 
How Websites go Serverless - WebSummit Lisbon 2018
How Websites go Serverless - WebSummit Lisbon 2018How Websites go Serverless - WebSummit Lisbon 2018
How Websites go Serverless - WebSummit Lisbon 2018Boaz Ziniman
 
Building a Modern Data Platform in the Cloud
Building a Modern Data Platform in the CloudBuilding a Modern Data Platform in the Cloud
Building a Modern Data Platform in the CloudAmazon Web Services
 
Machine Learning for innovation and transformation
Machine Learning for innovation and transformationMachine Learning for innovation and transformation
Machine Learning for innovation and transformationAmazon Web Services
 
Keeping the Pace with Data Ingestion (GPSCT402) - AWS re:Invent 2018
Keeping the Pace with Data Ingestion (GPSCT402) - AWS re:Invent 2018Keeping the Pace with Data Ingestion (GPSCT402) - AWS re:Invent 2018
Keeping the Pace with Data Ingestion (GPSCT402) - AWS re:Invent 2018Amazon Web Services
 

What's hot (19)

Enable Your Marketing Teams to Engage Users with Relevant & Personalized Cont...
Enable Your Marketing Teams to Engage Users with Relevant & Personalized Cont...Enable Your Marketing Teams to Engage Users with Relevant & Personalized Cont...
Enable Your Marketing Teams to Engage Users with Relevant & Personalized Cont...
 
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
 
Websites go Serverless - Floor28
Websites go Serverless - Floor28Websites go Serverless - Floor28
Websites go Serverless - Floor28
 
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
 
BDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMaker
BDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMakerBDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMaker
BDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMaker
 
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
 
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
 
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...
 
What's New in AR & VR: State of the World Report (ARV203) - AWS re:Invent 2018
What's New in AR & VR: State of the World Report (ARV203) - AWS re:Invent 2018What's New in AR & VR: State of the World Report (ARV203) - AWS re:Invent 2018
What's New in AR & VR: State of the World Report (ARV203) - AWS re:Invent 2018
 
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
 
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...
Serverless Architectural Patterns and Best Practices (ARC305-R2) - AWS re:Inv...
 
91APP 之API 經濟學與API Gateway與導入之旅
91APP 之API 經濟學與API Gateway與導入之旅91APP 之API 經濟學與API Gateway與導入之旅
91APP 之API 經濟學與API Gateway與導入之旅
 
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
 
Serverless applications with AWS
Serverless applications with AWSServerless applications with AWS
Serverless applications with AWS
 
How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...
How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...
How Disney Streaming Services and TrueCar Deliver Web Applications for Scale,...
 
How Websites go Serverless - WebSummit Lisbon 2018
How Websites go Serverless - WebSummit Lisbon 2018How Websites go Serverless - WebSummit Lisbon 2018
How Websites go Serverless - WebSummit Lisbon 2018
 
Building a Modern Data Platform in the Cloud
Building a Modern Data Platform in the CloudBuilding a Modern Data Platform in the Cloud
Building a Modern Data Platform in the Cloud
 
Machine Learning for innovation and transformation
Machine Learning for innovation and transformationMachine Learning for innovation and transformation
Machine Learning for innovation and transformation
 
Keeping the Pace with Data Ingestion (GPSCT402) - AWS re:Invent 2018
Keeping the Pace with Data Ingestion (GPSCT402) - AWS re:Invent 2018Keeping the Pace with Data Ingestion (GPSCT402) - AWS re:Invent 2018
Keeping the Pace with Data Ingestion (GPSCT402) - AWS re:Invent 2018
 

Similar to Taking your Progressive Web App to the Next Level with GraphQL and AWS AppSync

善用 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
 
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
 
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
 
Supercharging Applications with GraphQL and AWS AppSync
Supercharging Applications with GraphQL and AWS AppSyncSupercharging Applications with GraphQL and AWS AppSync
Supercharging Applications with GraphQL and AWS AppSyncAmazon Web Services
 
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
 
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
 
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
 
Cloud Backend for Real-time Applications
Cloud Backend for Real-time ApplicationsCloud Backend for Real-time Applications
Cloud Backend for Real-time ApplicationsAmazon Web Services
 
Building Real-time Serverless Backends
Building Real-time Serverless BackendsBuilding Real-time Serverless Backends
Building Real-time Serverless BackendsAmazon 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
 
Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...
Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...
Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...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
 
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...AWS Germany
 
Debug your Container and Serverless Applications with AWS X-Ray in 5 Minutes ...
Debug your Container and Serverless Applications with AWS X-Ray in 5 Minutes ...Debug your Container and Serverless Applications with AWS X-Ray in 5 Minutes ...
Debug your Container and Serverless Applications with AWS X-Ray in 5 Minutes ...Amazon Web Services
 
Accelerating Mobile App Data Synchronization and Real-Time Data Development w...
Accelerating Mobile App Data Synchronization and Real-Time Data Development w...Accelerating Mobile App Data Synchronization and Real-Time Data Development w...
Accelerating Mobile App Data Synchronization and Real-Time Data Development w...Amazon Web Services
 
Developing Serverless Application on AWS
Developing Serverless Application on AWSDeveloping Serverless Application on AWS
Developing Serverless Application on AWSAmazon Web Services
 

Similar to Taking your Progressive Web App to the Next Level with GraphQL and AWS AppSync (20)

善用 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)
 
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
 
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
 
Supercharging Applications with GraphQL and AWS AppSync
Supercharging Applications with GraphQL and AWS AppSyncSupercharging Applications with GraphQL and AWS AppSync
Supercharging Applications with GraphQL and AWS AppSync
 
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...
 
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...
 
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
 
Cloud Backend for Real-time Applications
Cloud Backend for Real-time ApplicationsCloud Backend for Real-time Applications
Cloud Backend for Real-time Applications
 
Microservices for Startups
Microservices for StartupsMicroservices for Startups
Microservices for Startups
 
Building Real-time Serverless Backends
Building Real-time Serverless BackendsBuilding Real-time Serverless Backends
Building Real-time Serverless Backends
 
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
 
Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...
Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...
Bridging the Gap Between Real Time/Offline and AI/ML Capabilities in Modern S...
 
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) ...
 
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
 
Debug your Container and Serverless Applications with AWS X-Ray in 5 Minutes ...
Debug your Container and Serverless Applications with AWS X-Ray in 5 Minutes ...Debug your Container and Serverless Applications with AWS X-Ray in 5 Minutes ...
Debug your Container and Serverless Applications with AWS X-Ray in 5 Minutes ...
 
Accelerating Mobile App Data Synchronization and Real-Time Data Development w...
Accelerating Mobile App Data Synchronization and Real-Time Data Development w...Accelerating Mobile App Data Synchronization and Real-Time Data Development w...
Accelerating Mobile App Data Synchronization and Real-Time Data Development w...
 
Developing Serverless Application on AWS
Developing Serverless Application on AWSDeveloping Serverless Application on AWS
Developing Serverless Application on AWS
 

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
 

Taking your Progressive Web App to the Next Level with GraphQL and AWS AppSync

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Ed Lima – Solutions Architect July 2018 Taking your Progressive Web App to the Next Level with GraphQL and AWS AppSync @ednergizer
  • 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Digital Media 50% 34% 9% 7% Mobile App Desktop Mobile Web Tablet App Time spent comScore Media Metrix Multi-Platform & Mobile Metrix, U.S., Total Audience, June 2017
  • 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. comScore Media Metrix Multi-Platform & Mobile Metrix, U.S., Total Audience, June 2017 0 5 11 16 21 Unique Visitors Mobile Web Mobile App Average Monthly Unique Visitors 2.2x Mobile App
  • 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Progress to Progressive
  • 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Progressive Web Apps (PWA) Responsive web application Defined by manifest.json Discoverable and installable A Progressive Web App uses modern web capabilities to deliver an app-like user experience
  • 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Why Progressive Web Apps Secure ShareableNetwork Agnostic Always up-to-date
  • 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Core Components Application shell Service worker Storage and cache
  • 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Toolchain & Production Scale • Web framework (Ember.js, Angular.js, Ionic, React, etc.) • CLI/build system (Workbox, Ionic, Grunt/Gulp, AWS CLI) • Libraries/utilities (Local Forage, Handlebars) • Deployment (CloudFront, S3, AWS Mobile CLI, Mobile Hub)
  • 12. What about the backend?
  • 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Traditional Data Fetching Data  Trivial to set up  Standard HTTP Calls ❌ Relationships ❌ Lists with reduced information ❌ Query support ❌ Ordering and pagination ❌ Notifications /posts /postInfo /postJustTitle /postsByAuthor /postNameStartsX /postByTag /commentsOnPost REST Endpoints
  • 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Is there a better way
  • 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. GraphQL
  • 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What is GraphQL? Uniform API across data stores and APIs Network optimized requests and responses Powerful developer tools Integrated documentation and introspection Describe what’s possible with a type system Query language for your API and a runtime for fulfilling queries with existing data
  • 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What Is GraphQL? /posts /comments /authors REST API posts comments authors GraphQL API
  • 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. query { getEvent(id: 1){ id name } } mutation { createEvent(name:”MeetUp”){ id } } subscription { onCreateComment { id } } GraphQL Operations Queries Read Data Mutations Write Data Subscriptions Receive Data in Real-Time
  • 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How to Use GraphQL type Query { listEvents: [Event] } type Event { id: ID! name: String! when: String! where: String! } query { listEvents { id name } } { "id": "1", "name": "React Meet Up" }, { "id": "2", "name": "GraphQL Party" }, { “id”: “3”, “name”: “Angular Sesh” } ... Define your data (Schema) Invoke Operation Get EXACTLY what you asked for
  • 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How to Use GraphQL type Query { listEvents: [Event] } type Event { id: ID! name: String! when: String! where: String! } query { listEvents { id name when } } { "id": "1”, "name": "React Meet Up”, “when”: “Tomorrow” }, { "id": "2", "name": "GraphQL Party", “when”: “Saturday” }, { “id”: “3”, “name”: “Angular Sesh”, “when”: “Next Friday” }... Define your data (Schema) Invoke Operation Get EXACTLY what you asked for
  • 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. GraphQL sounds legit! I want to run my own GraphQL server!!
  • 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Focus on Apps Not Infrastructure
  • 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS AppSync Managed Serverless GraphQL service Connect to data sources in your account Add data sync, real-time and offline capabilities for any data source or API GraphQL façade for any AWS service Conflict detection and resolution in the cloud Enterprise security features (IAM, Cognito, OIDC, API keys)
  • 25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AppSync is first and foremost an application data service with real-time and offline features implemented over GraphQL with additional capabilities such as built-in authorization and conflict resolution. But what is AWS AppSync really?
  • 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How does AppSync work? Create, Import or Upload GraphQL Schema Amazon Elasticsearch Amazon DynamoDB AWS Lambda Connect Data Sources AppSync Updates Data in Real Time and Manages Data when Offline __________ ______________ ___________ _________ ___________ ____________ __________ NEW
  • 27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Building data-driven apps with AWS AppSync Robust, scalable storage capable of handling millions of events a day Geospatial search Real-time updatesMobile and Web clients
  • 28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS AppSync Benefits Clients receive the data they ask for. Nothing more, nothing less Get many resources from many data sources with a single request Self-documenting APIs with Introspection React Native, Android, iOS, and Web (JS) using the Apollo GraphQL client Data persistence across application restarts Write-through mutations with optimistic UI
  • 29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Elasticsearch DynamoDB Browser Mobile device WebSocket servers Web servers PubSub servers Subscription /search /taps /taps/:id /m_search AWS Lambda Third-party service … Real-Time App before AppSync
  • 30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. /graphql AWS AppSync Subscription Elasticsearch DynamoDB AWS Lambda Third-party service Real-Time App after AppSync
  • 31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Real-Time Updates • GraphQL subscriptions • Event stream of mutation results • Data synchronization with MQTT + WebSockets • Client managed WebSocket connection • Automatic catch-up snapshots
  • 32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Data Conflicts Jane Version : 2 Updated Document Jane Version : 2 Updated Document Version : 3 Updated Document Version : 1 New Document Time John John Jane goes offline Jane comes back online Version : 4 Updated Document John Jane
  • 33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Handle Data Conflicts in the Cloud • Conflict detection with optimistic version check. • Conflict resolution strategies: A. Client wins B. Server wins C. Silent reject D. Custom logic in AWS Lambda • Client callback for conflict resolution is available. "condition" : { "expression" : "someExpression" "conditionalCheckFailedHandler" : { "strategy" : "Custom", "lambdaArn" : "arn:..." } }
  • 34. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Offline Capabilities - AppSync Client Storage • Offline is a write-through "Store" • Persistent storage mediums back the Apollo normalized cache • Local Storage for web • AsyncStorage for React Native • SQLite on native platforms • Database can be preloaded • Offline client can be configured • WiFi only • WiFi and cellular
  • 35. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon API Gateway AWS AppSync
  • 36. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon API Gateway AWS AppSync vs
  • 37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon API Gateway AWS AppSync vs
  • 38. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon API Gateway AWS AppSync &
  • 39. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon API Gateway AWS AppSync &
  • 40. Enough Talking https://aws.amazon.com/appsync/resources/#Starter_applications (Angular Chat App) https://github.com/aws-samples/aws-mobile-appsync-chat-starter-angular https://aws.amazon.com/blogs/mobile/building-a-serverless-real-time-chat-application-with-aws-appsync/
  • 41. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 42. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Cognito User Pools JWT Token GraphQL Schema ChatQL Conversations Table Messages Table User Conversations Table Users Table Amazon DynamoDB Queries and Mutations Subscriptions AppSync Resolvers User AWS AppSync AppSync Data Sources
  • 43. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. User 1..1 1..n 1..1 1..n 1..n User Conversation Conversation Messages GraphQL Relations between NoSQL DynamoDB Tables
  • 44. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Demo Time!
  • 45. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Takeaways Don’t boil the Ocean. Start small and iterate on Offline (cache-and- network), Real-time and Conflict Resolution Use UI cues with Optimistic UI when Offline Take advantage of built-in GraphQL powerful features such as Connections (Pagination) and Relations (NoSQL) It’s all about the User Experience: PWAs + AppSync = 
  • 46. It’s all about the User Experience ! https://secure.i.telegraph.co.uk/multimedia/archive/02884/babies_2884567b.jpg