SlideShare a Scribd company logo
1 of 39
Download to read offline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
0 to 60 with AWS AppSync:
Rapid Development Techniques for
Mobile APIs
Josh Kahn
Solutions Architect
AWS
M O B 3 2 0
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is AWS AppSync?
Managed Serverless
GraphQL service
Connect to data sources in
your account
Add data sync, real-time and
offline capabilities
GraphQL façade for
any AWS service
Conflict detection and
resolution in the
cloud
Enterprise security
features (IAM,
Cognito, API keys)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How does GraphQL work?
type Query {
getTodos: [Todo]
}
type Todo {
id: ID!
name: String
description: String
priority: Int
duedate: String
}
Model data with
application schema
query {
getTodos {
id
name
priority
}
}
Client requests
what it needs
{
"id": "1",
"name": "Get Milk",
"priority": "1"
},
{
"id": "2",
"name": "Go to gym",
"priority": "5"
},…
Only that data is
returned
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
GraphQL Operations
Queries
Read data
Mutations
Write data
Subscriptions
Listen for data
query {
search(q: “harry potter”) {
title
}
}
mutation {
create(title: “new book”) {
id
}
}
subscription {
onCreate {
id
title
}
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS AppSync Data Sources
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS AppSync Resolvers
© 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.
ElastiLodge – Boutique Hotels
• Today’s mobile experience is lacking:
• Mobile website, no native apps
• Slow, cumbersome to book reservations leading to low conversion rates
• Backend was built for high-speed desktop connectivity
• Building tomorrow’s mobile experience:
• Management has hired a digital agency to design all-new mobile experience
• Agency contracted to deliver functional prototype in four weeks
• To be most impactful, must use real data and allow reservation booking
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Our Goals
• Enable backend services for prototype experience
• Keep up with our day job:
• Services operations
• Monolithic reservation application
• Allow design to evolve
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
{
"_id": 3,
"name": "ElastiLodge South Zanetown",
"image": "https://placehold.it/300x300.png",
"description": "Sint nostrum vel quibusdam quia reprehenderit cum exercitationem quia ea.",
"location": "South Zanetown",
"manager": {
"name": "Florentino Jacobi",
"email": "florentino.jacobi@elastilodge.com"
},
"timeZone": "US/Central",
"phoneNumber": "802-918-3262",
"category": 5,
"address": {
"street": "410 Simonis Forest",
"zip": "07545-2308",
"city": "South Zanetown",
"country": "Virgin Islands, British"
},
"deskHours": "24 hours",
"amenities": [ ... ],
"restaurants": [ ... ]
}
Legacy API: Sample Response
© 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.
Hotel Detail: Design
• What data is required?
• Can we use existing data
sources?
• How can we enable via
AWS AppSync?
• Challenges? Missing
data?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Mapping to Legacy API {
"_id": 3,
"image": "https://placehold.it/300x300.png",
"name": "EL Resort & Spa",
"description": "...",
"location": "Fiji",
"manager": {
"name": "Florentino Jacobi",
"email": "florentino.jacobi@elastilodge.com"
},
"timeZone": "US/Central",
"address": {
"street": "123 Main St",
”postalcode": "07545",
"city": "Momi Bay",
"country": "Fiji"
},
"phoneNumber": "1-888-123-4567",
"category": 5,
"deskHours": "24 hours",
"amenities": [ ... ],
"restaurants": [ ... ]
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Mapping to Legacy API {
"_id": 3,
"image": "https://placehold.it/300x300.png",
"name": "EL Resort & Spa",
"description": "...",
"location": "Fiji",
"manager": {
"name": "Florentino Jacobi",
"email": "florentino.jacobi@elastilodge.com"
},
"timeZone": "US/Central",
"address": {
"street": "123 Main St",
”postalcode": "07545",
"city": "Momi Bay",
"country": "Fiji"
},
"phoneNumber": "1-888-123-4567",
"category": 5,
"deskHours": "24 hours",
"amenities": [ ... ],
"restaurants": [ ... ]
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Hotel Detail: GraphQL Schema
type Hotel {
hotelId: ID!
name: String!
image: String
location: String!
phoneNumber: AWSPhone!
address: Address!
...
}
type Query {
listHotels(offset: String, limit: Int)
getHotel(hotelId: ID!)
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Hotel Detail: Resolvers
## Resolver: Request Mapping ##
{
"version": "2018-05-29",
"method": "GET",
"resourcePath": "/hotels/${ctx.args.hotelId}",
"params": {
"headers": {
"Content-Type": "application/json"
}
},
}
## Resolver: Response Mapping ##
#if($ctx.result.statusCode == 200)
## If response is 200, return the body.
## Could also filter result...
$ctx.result.body
#else
## If not 200, append response to error
$utils.appendError($ctx.result.body)
#end
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Hotel Detail: Result
query {
getHotel(hotelId: 3) {
name
location
image
phoneNumber
address {
street
city
}
amenities
}
}
{
"name": "ElastiLodge North Rodgerstad",
"location": "North Rodgerstad",
"image": "https://placehold.it/300x300.png",
"phoneNumber": "(214) 210-4674",
"address": {
"street": "123 Main St",
"city": "North Rodgerstad"
},
"amenities": [ ... ]
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Reservations: Design
• What data is required?
• Can we use existing data
sources?
• How can we enable via
AWS AppSync?
• Challenges?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Reservations: GraphQL Schema
type Reservation {
confirmationNumber: ID!
hotel: Hotel!
guest: User!
startDate: AWSDate!
endDate: AWSDate!
rate: Int!
}
type Query {
...
guestReservations:[Reservation]
}
type Mutation {
createReservation(input: ReservationInput)
deleteReservation(confNum: ID!)
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Reservations: Query Resolver
#set( $todayString = $util.time.nowISO8601().substring(0, 10) )
{
"version": "2017-02-28",
"operation": "Query",
"query": {
"expression": "guestId = :gId AND startDate > :startDate",
"expressionValues": {
":gId": $util.dynamodb.toDynamoDBJson($ctx.identity.sub),
":startDate": $util.dynamodb.toDynamoDBJson($todayString)
}
}
}
Note: assumes user is logged in via AWS Cognito User Pool. Details are outside our scope.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Reservations: Mutation Resolvers
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Reservations: Result
query {
guestReservations {
confirmationNumber
hotel {
hotelId
name
image
phoneNumber
}
startDate
endDate
}
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Extending Reservation Workflow
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Adaptive Rates: Design
• R&D is building an
adaptive rate capability
• Delivered via Amazon
SageMaker API
• How do we add today’s
rate to our existing API?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Adaptive Rates: Evolving our GraphQL API
GraphQL supports multiple
data sources per query:
1. Add new field
2. Configure new Data Source
and Resolvers
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Adaptive Rates: GraphQL Types and Resolvers
type Hotel {
hotelId: ID!
name: String!
location: String!
...
rate: Rate
}
type Rate {
hotelId: ID!
rate: Int!
currency: String!
date: AWSDate!
}
## rate Field Resolver: Request Mapping ##
{
"version": "2018-05-29",
"method": "GET",
"resourcePath":
"/rd/rates/${ctx.source.hotelId}",
"params": {
"headers": {
"Content-Type": "application/json"
}
}
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Adaptive Rates: Result
query {
getHotel(hotelId: 3) {
name
location
image
phoneNumber
address {
street
city
}
amenities
rate {
currency
rate
}
}
}
{
"name": "ElastiLodge North Rodgerstad",
"location": "North Rodgerstad",
"image": "https://placehold.it/300x300.png",
"phoneNumber": "(214) 210-4674",
"address": {
"street": "",
"city": ""
},
"amenities": [ ... ],
"rate": {
"currency": "USD",
"rate": 312
}
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What did we accomplish today?
• Built a rich, flexible, mobile-ready API
• Incorporated legacy, new, and prototype features in a single endpoint
• Evolved API as requirements changed
• No coding required!
• Well, there were a few Velocity Templates
• AWS console includes starter / boilerplate templates
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Extra Credit
• Other design ideas?
• A few of mine:
• Add today’s weather in hotel
location
• Search for hotel by location,
date, or rate
• Search by geolocation
• Allow users to upload photos
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Amplify CLI
• Toolchain for developers
• Enables you to prototype and
build quickly
• Built-in GraphQL
Transformer
• Converts schema to AWS
CloudFormation templates and
builds cloud resources
$ amplify api add
# create GraphQL schema
# for example:
type Hotel @model @searchable {
name: String!
location: String!
...
}
https://github.com/aws-amplify/amplify-cli
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Finished Solution
https://github.com/jkahn117/reinvent2018-mob320
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Josh Kahn
jkahn@amazon.com
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

More Related Content

What's hot

Build a Serverless Application using GraphQL & AWS AppSync
Build a Serverless Application using GraphQL & AWS AppSyncBuild a Serverless Application using GraphQL & AWS AppSync
Build a Serverless Application using GraphQL & AWS AppSyncAmazon Web Services
 
Authentication & Authorization in GraphQL with AWS AppSync (MOB402) - AWS re:...
Authentication & Authorization in GraphQL with AWS AppSync (MOB402) - AWS re:...Authentication & Authorization in GraphQL with AWS AppSync (MOB402) - AWS re:...
Authentication & Authorization in GraphQL with AWS AppSync (MOB402) - AWS re:...Amazon Web Services
 
How ThingLogix Redefined the Conference Experience for VMworld Attendees (ARV...
How ThingLogix Redefined the Conference Experience for VMworld Attendees (ARV...How ThingLogix Redefined the Conference Experience for VMworld Attendees (ARV...
How ThingLogix Redefined the Conference Experience for VMworld Attendees (ARV...Amazon Web Services
 
What's New with Amazon Redshift ft. McDonald's (ANT350-R1) - AWS re:Invent 2018
What's New with Amazon Redshift ft. McDonald's (ANT350-R1) - AWS re:Invent 2018What's New with Amazon Redshift ft. McDonald's (ANT350-R1) - AWS re:Invent 2018
What's New with Amazon Redshift ft. McDonald's (ANT350-R1) - AWS re:Invent 2018Amazon Web Services
 
Cost Optimization Tooling (ARC301) - AWS re:Invent 2018
Cost Optimization Tooling (ARC301) - AWS re:Invent 2018Cost Optimization Tooling (ARC301) - AWS re:Invent 2018
Cost Optimization Tooling (ARC301) - AWS re:Invent 2018Amazon Web Services
 
MassMutual Goes Cloud First with Hybrid Cloud on AWS (ENT210) - AWS re:Invent...
MassMutual Goes Cloud First with Hybrid Cloud on AWS (ENT210) - AWS re:Invent...MassMutual Goes Cloud First with Hybrid Cloud on AWS (ENT210) - AWS re:Invent...
MassMutual Goes Cloud First with Hybrid Cloud on AWS (ENT210) - AWS re:Invent...Amazon Web Services
 
Edge Computing with AWS Greengrass
Edge Computing with AWS Greengrass Edge Computing with AWS Greengrass
Edge Computing with AWS Greengrass 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
 
Best Practices for Safe Deployments on AWS Lambda and Amazon API Gateway (SRV...
Best Practices for Safe Deployments on AWS Lambda and Amazon API Gateway (SRV...Best Practices for Safe Deployments on AWS Lambda and Amazon API Gateway (SRV...
Best Practices for Safe Deployments on AWS Lambda and Amazon API Gateway (SRV...Amazon Web Services
 
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...Amazon Web Services
 
Introducing AWS AppSync: serverless data driven apps with real-time and offli...
Introducing AWS AppSync: serverless data driven apps with real-time and offli...Introducing AWS AppSync: serverless data driven apps with real-time and offli...
Introducing AWS AppSync: serverless data driven apps with real-time and offli...Amazon Web Services
 
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...Amazon Web Services
 
DEM07 Best Practices for Monitoring Amazon ECS Containers Launched with Fargate
DEM07 Best Practices for Monitoring Amazon ECS Containers Launched with FargateDEM07 Best Practices for Monitoring Amazon ECS Containers Launched with Fargate
DEM07 Best Practices for Monitoring Amazon ECS Containers Launched with FargateAmazon Web Services
 
How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...
How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...
How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...Amazon Web Services
 
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...Amazon Web Services
 
The Amazon.com Database Journey to AWS – Top 10 Lessons Learned (DAT326) - AW...
The Amazon.com Database Journey to AWS – Top 10 Lessons Learned (DAT326) - AW...The Amazon.com Database Journey to AWS – Top 10 Lessons Learned (DAT326) - AW...
The Amazon.com Database Journey to AWS – Top 10 Lessons Learned (DAT326) - AW...Amazon Web Services
 
Tiered Data Sets in Amazon Redshift (ANT321) - AWS re:Invent 2018
Tiered Data Sets in Amazon Redshift (ANT321) - AWS re:Invent 2018Tiered Data Sets in Amazon Redshift (ANT321) - AWS re:Invent 2018
Tiered Data Sets in Amazon Redshift (ANT321) - AWS re:Invent 2018Amazon Web Services
 
Securing Machine Learning Deployments for the Enterprise (SEC369-R1) - AWS re...
Securing Machine Learning Deployments for the Enterprise (SEC369-R1) - AWS re...Securing Machine Learning Deployments for the Enterprise (SEC369-R1) - AWS re...
Securing Machine Learning Deployments for the Enterprise (SEC369-R1) - AWS re...Amazon Web Services
 
A New Approach to Continuous Monitoring in the Cloud: Migrate to AWS with NET...
A New Approach to Continuous Monitoring in the Cloud: Migrate to AWS with NET...A New Approach to Continuous Monitoring in the Cloud: Migrate to AWS with NET...
A New Approach to Continuous Monitoring in the Cloud: Migrate to AWS with NET...Amazon Web Services
 
Developing Well Architected iOS Apps with AWS (MOB303) - AWS re:Invent 2018
Developing Well Architected iOS Apps with AWS (MOB303) - AWS re:Invent 2018Developing Well Architected iOS Apps with AWS (MOB303) - AWS re:Invent 2018
Developing Well Architected iOS Apps with AWS (MOB303) - AWS re:Invent 2018Amazon Web Services
 

What's hot (20)

Build a Serverless Application using GraphQL & AWS AppSync
Build a Serverless Application using GraphQL & AWS AppSyncBuild a Serverless Application using GraphQL & AWS AppSync
Build a Serverless Application using GraphQL & AWS AppSync
 
Authentication & Authorization in GraphQL with AWS AppSync (MOB402) - AWS re:...
Authentication & Authorization in GraphQL with AWS AppSync (MOB402) - AWS re:...Authentication & Authorization in GraphQL with AWS AppSync (MOB402) - AWS re:...
Authentication & Authorization in GraphQL with AWS AppSync (MOB402) - AWS re:...
 
How ThingLogix Redefined the Conference Experience for VMworld Attendees (ARV...
How ThingLogix Redefined the Conference Experience for VMworld Attendees (ARV...How ThingLogix Redefined the Conference Experience for VMworld Attendees (ARV...
How ThingLogix Redefined the Conference Experience for VMworld Attendees (ARV...
 
What's New with Amazon Redshift ft. McDonald's (ANT350-R1) - AWS re:Invent 2018
What's New with Amazon Redshift ft. McDonald's (ANT350-R1) - AWS re:Invent 2018What's New with Amazon Redshift ft. McDonald's (ANT350-R1) - AWS re:Invent 2018
What's New with Amazon Redshift ft. McDonald's (ANT350-R1) - AWS re:Invent 2018
 
Cost Optimization Tooling (ARC301) - AWS re:Invent 2018
Cost Optimization Tooling (ARC301) - AWS re:Invent 2018Cost Optimization Tooling (ARC301) - AWS re:Invent 2018
Cost Optimization Tooling (ARC301) - AWS re:Invent 2018
 
MassMutual Goes Cloud First with Hybrid Cloud on AWS (ENT210) - AWS re:Invent...
MassMutual Goes Cloud First with Hybrid Cloud on AWS (ENT210) - AWS re:Invent...MassMutual Goes Cloud First with Hybrid Cloud on AWS (ENT210) - AWS re:Invent...
MassMutual Goes Cloud First with Hybrid Cloud on AWS (ENT210) - AWS re:Invent...
 
Edge Computing with AWS Greengrass
Edge Computing with AWS Greengrass Edge Computing with AWS Greengrass
Edge Computing with AWS Greengrass
 
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
 
Best Practices for Safe Deployments on AWS Lambda and Amazon API Gateway (SRV...
Best Practices for Safe Deployments on AWS Lambda and Amazon API Gateway (SRV...Best Practices for Safe Deployments on AWS Lambda and Amazon API Gateway (SRV...
Best Practices for Safe Deployments on AWS Lambda and Amazon API Gateway (SRV...
 
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...
Eliminate Migration Confusion: Speed Migration with Automated Tracking (ENT31...
 
Introducing AWS AppSync: serverless data driven apps with real-time and offli...
Introducing AWS AppSync: serverless data driven apps with real-time and offli...Introducing AWS AppSync: serverless data driven apps with real-time and offli...
Introducing AWS AppSync: serverless data driven apps with real-time and offli...
 
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...
Advanced Design Patterns for Amazon DynamoDB - Workshop (DAT404-R1) - AWS re:...
 
DEM07 Best Practices for Monitoring Amazon ECS Containers Launched with Fargate
DEM07 Best Practices for Monitoring Amazon ECS Containers Launched with FargateDEM07 Best Practices for Monitoring Amazon ECS Containers Launched with Fargate
DEM07 Best Practices for Monitoring Amazon ECS Containers Launched with Fargate
 
How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...
How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...
How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...
 
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
 
The Amazon.com Database Journey to AWS – Top 10 Lessons Learned (DAT326) - AW...
The Amazon.com Database Journey to AWS – Top 10 Lessons Learned (DAT326) - AW...The Amazon.com Database Journey to AWS – Top 10 Lessons Learned (DAT326) - AW...
The Amazon.com Database Journey to AWS – Top 10 Lessons Learned (DAT326) - AW...
 
Tiered Data Sets in Amazon Redshift (ANT321) - AWS re:Invent 2018
Tiered Data Sets in Amazon Redshift (ANT321) - AWS re:Invent 2018Tiered Data Sets in Amazon Redshift (ANT321) - AWS re:Invent 2018
Tiered Data Sets in Amazon Redshift (ANT321) - AWS re:Invent 2018
 
Securing Machine Learning Deployments for the Enterprise (SEC369-R1) - AWS re...
Securing Machine Learning Deployments for the Enterprise (SEC369-R1) - AWS re...Securing Machine Learning Deployments for the Enterprise (SEC369-R1) - AWS re...
Securing Machine Learning Deployments for the Enterprise (SEC369-R1) - AWS re...
 
A New Approach to Continuous Monitoring in the Cloud: Migrate to AWS with NET...
A New Approach to Continuous Monitoring in the Cloud: Migrate to AWS with NET...A New Approach to Continuous Monitoring in the Cloud: Migrate to AWS with NET...
A New Approach to Continuous Monitoring in the Cloud: Migrate to AWS with NET...
 
Developing Well Architected iOS Apps with AWS (MOB303) - AWS re:Invent 2018
Developing Well Architected iOS Apps with AWS (MOB303) - AWS re:Invent 2018Developing Well Architected iOS Apps with AWS (MOB303) - AWS re:Invent 2018
Developing Well Architected iOS Apps with AWS (MOB303) - AWS re:Invent 2018
 

Similar to 0 to 60 with AWS AppSync: Rapid Development Techniques for Mobile APIs (MOB320-R1) - AWS re:Invent 2018

0 to 100kmh with GraphQL - Rapid API Prototyping using serverless backend in...
 0 to 100kmh with GraphQL - Rapid API Prototyping using serverless backend in... 0 to 100kmh with GraphQL - Rapid API Prototyping using serverless backend in...
0 to 100kmh with GraphQL - Rapid API Prototyping using serverless backend in...Amazon Web Services
 
0 to 100kmh with GraphQL. Rapid API Prototyping usingserverless backend in t...
0 to 100kmh with GraphQL.  Rapid API Prototyping usingserverless backend in t...0 to 100kmh with GraphQL.  Rapid API Prototyping usingserverless backend in t...
0 to 100kmh with GraphQL. Rapid API Prototyping usingserverless backend in t...Amazon Web Services
 
Rapid API Prototyping Using Serverless Backend in the Cloud
Rapid API Prototyping Using Serverless Backend in the CloudRapid API Prototyping Using Serverless Backend in the Cloud
Rapid API Prototyping Using Serverless Backend in the CloudAmazon Web Services
 
AppSync in real world - pitfalls, unexpected benefits & lessons learnt
AppSync in real world - pitfalls, unexpected benefits & lessons learntAppSync in real world - pitfalls, unexpected benefits & lessons learnt
AppSync in real world - pitfalls, unexpected benefits & lessons learntAWS User Group Bengaluru
 
Introduction to GraphQL and AWS Appsync on AWS - iOS
Introduction to GraphQL and AWS Appsync on AWS - iOSIntroduction to GraphQL and AWS Appsync on AWS - iOS
Introduction to GraphQL and AWS Appsync on AWS - iOSAmazon Web Services
 
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...Amazon Web Services
 
Evolving your Data Access with MongoDB Stitch
Evolving your Data Access with MongoDB StitchEvolving your Data Access with MongoDB Stitch
Evolving your Data Access with MongoDB StitchMongoDB
 
Build a "Who's Who" App for Your Media Content (AIM409) - AWS re:Invent 2018
Build a "Who's Who" App for Your Media Content (AIM409) - AWS re:Invent 2018Build a "Who's Who" App for Your Media Content (AIM409) - AWS re:Invent 2018
Build a "Who's Who" App for Your Media Content (AIM409) - AWS re:Invent 2018Amazon Web Services
 
AWS Neptune - A Fast and reliable Graph Database Built for the Cloud
AWS Neptune - A Fast and reliable Graph Database Built for the CloudAWS Neptune - A Fast and reliable Graph Database Built for the Cloud
AWS Neptune - A Fast and reliable Graph Database Built for the CloudAmazon Web Services
 
Migrate an existing application RESTful API’s to GraphQL using AWS Amplify an...
Migrate an existing application RESTful API’s to GraphQL using AWS Amplify an...Migrate an existing application RESTful API’s to GraphQL using AWS Amplify an...
Migrate an existing application RESTful API’s to GraphQL using AWS Amplify an...Amazon Web Services
 
Making Sense of Schema on Read
Making Sense of Schema on ReadMaking Sense of Schema on Read
Making Sense of Schema on ReadKent Graziano
 
Executing a Large Scale Migration to AWS (ENT337-R2) - AWS re:Invent 2018
Executing a Large Scale Migration to AWS (ENT337-R2) - AWS re:Invent 2018Executing a Large Scale Migration to AWS (ENT337-R2) - AWS re:Invent 2018
Executing a Large Scale Migration to AWS (ENT337-R2) - AWS re:Invent 2018Amazon Web Services
 
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...Amazon Web Services
 
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...Amazon Web Services
 
Build an Interactive Alexa Voice Experience for Multiple Screens (ALX314-R2) ...
Build an Interactive Alexa Voice Experience for Multiple Screens (ALX314-R2) ...Build an Interactive Alexa Voice Experience for Multiple Screens (ALX314-R2) ...
Build an Interactive Alexa Voice Experience for Multiple Screens (ALX314-R2) ...Amazon Web Services
 
Real-Time Personalized Customer Experiences at Bonobos (RET203) - AWS re:Inve...
Real-Time Personalized Customer Experiences at Bonobos (RET203) - AWS re:Inve...Real-Time Personalized Customer Experiences at Bonobos (RET203) - AWS re:Inve...
Real-Time Personalized Customer Experiences at Bonobos (RET203) - AWS re:Inve...Amazon 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
 
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...Amazon Web Services
 
Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify
Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify
Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify Amazon Web Services
 

Similar to 0 to 60 with AWS AppSync: Rapid Development Techniques for Mobile APIs (MOB320-R1) - AWS re:Invent 2018 (20)

0 to 100kmh with GraphQL - Rapid API Prototyping using serverless backend in...
 0 to 100kmh with GraphQL - Rapid API Prototyping using serverless backend in... 0 to 100kmh with GraphQL - Rapid API Prototyping using serverless backend in...
0 to 100kmh with GraphQL - Rapid API Prototyping using serverless backend in...
 
0 to 100kmh with GraphQL. Rapid API Prototyping usingserverless backend in t...
0 to 100kmh with GraphQL.  Rapid API Prototyping usingserverless backend in t...0 to 100kmh with GraphQL.  Rapid API Prototyping usingserverless backend in t...
0 to 100kmh with GraphQL. Rapid API Prototyping usingserverless backend in t...
 
Rapid API Prototyping Using Serverless Backend in the Cloud
Rapid API Prototyping Using Serverless Backend in the CloudRapid API Prototyping Using Serverless Backend in the Cloud
Rapid API Prototyping Using Serverless Backend in the Cloud
 
AppSync in real world - pitfalls, unexpected benefits & lessons learnt
AppSync in real world - pitfalls, unexpected benefits & lessons learntAppSync in real world - pitfalls, unexpected benefits & lessons learnt
AppSync in real world - pitfalls, unexpected benefits & lessons learnt
 
AppSync and GraphQL on iOS
AppSync and GraphQL on iOSAppSync and GraphQL on iOS
AppSync and GraphQL on iOS
 
Introduction to GraphQL and AWS Appsync on AWS - iOS
Introduction to GraphQL and AWS Appsync on AWS - iOSIntroduction to GraphQL and AWS Appsync on AWS - iOS
Introduction to GraphQL and AWS Appsync on AWS - iOS
 
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...
 
Evolving your Data Access with MongoDB Stitch
Evolving your Data Access with MongoDB StitchEvolving your Data Access with MongoDB Stitch
Evolving your Data Access with MongoDB Stitch
 
Build a "Who's Who" App for Your Media Content (AIM409) - AWS re:Invent 2018
Build a "Who's Who" App for Your Media Content (AIM409) - AWS re:Invent 2018Build a "Who's Who" App for Your Media Content (AIM409) - AWS re:Invent 2018
Build a "Who's Who" App for Your Media Content (AIM409) - AWS re:Invent 2018
 
AWS Neptune - A Fast and reliable Graph Database Built for the Cloud
AWS Neptune - A Fast and reliable Graph Database Built for the CloudAWS Neptune - A Fast and reliable Graph Database Built for the Cloud
AWS Neptune - A Fast and reliable Graph Database Built for the Cloud
 
Migrate an existing application RESTful API’s to GraphQL using AWS Amplify an...
Migrate an existing application RESTful API’s to GraphQL using AWS Amplify an...Migrate an existing application RESTful API’s to GraphQL using AWS Amplify an...
Migrate an existing application RESTful API’s to GraphQL using AWS Amplify an...
 
Making Sense of Schema on Read
Making Sense of Schema on ReadMaking Sense of Schema on Read
Making Sense of Schema on Read
 
Executing a Large Scale Migration to AWS (ENT337-R2) - AWS re:Invent 2018
Executing a Large Scale Migration to AWS (ENT337-R2) - AWS re:Invent 2018Executing a Large Scale Migration to AWS (ENT337-R2) - AWS re:Invent 2018
Executing a Large Scale Migration to AWS (ENT337-R2) - AWS re:Invent 2018
 
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
 
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
 
Build an Interactive Alexa Voice Experience for Multiple Screens (ALX314-R2) ...
Build an Interactive Alexa Voice Experience for Multiple Screens (ALX314-R2) ...Build an Interactive Alexa Voice Experience for Multiple Screens (ALX314-R2) ...
Build an Interactive Alexa Voice Experience for Multiple Screens (ALX314-R2) ...
 
Real-Time Personalized Customer Experiences at Bonobos (RET203) - AWS re:Inve...
Real-Time Personalized Customer Experiences at Bonobos (RET203) - AWS re:Inve...Real-Time Personalized Customer Experiences at Bonobos (RET203) - AWS re:Inve...
Real-Time Personalized Customer Experiences at Bonobos (RET203) - AWS re:Inve...
 
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
 
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
 
Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify
Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify
Take Mobile and Web Apps to the Next Level with AWS AppSync and AWS Amplify
 

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
 

0 to 60 with AWS AppSync: Rapid Development Techniques for Mobile APIs (MOB320-R1) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 0 to 60 with AWS AppSync: Rapid Development Techniques for Mobile APIs Josh Kahn Solutions Architect AWS M O B 3 2 0
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is AWS AppSync? Managed Serverless GraphQL service Connect to data sources in your account Add data sync, real-time and offline capabilities GraphQL façade for any AWS service Conflict detection and resolution in the cloud Enterprise security features (IAM, Cognito, API keys)
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How does GraphQL work? type Query { getTodos: [Todo] } type Todo { id: ID! name: String description: String priority: Int duedate: String } Model data with application schema query { getTodos { id name priority } } Client requests what it needs { "id": "1", "name": "Get Milk", "priority": "1" }, { "id": "2", "name": "Go to gym", "priority": "5" },… Only that data is returned
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. GraphQL Operations Queries Read data Mutations Write data Subscriptions Listen for data query { search(q: “harry potter”) { title } } mutation { create(title: “new book”) { id } } subscription { onCreate { id title } }
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS AppSync Data Sources
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS AppSync Resolvers
  • 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. ElastiLodge – Boutique Hotels • Today’s mobile experience is lacking: • Mobile website, no native apps • Slow, cumbersome to book reservations leading to low conversion rates • Backend was built for high-speed desktop connectivity • Building tomorrow’s mobile experience: • Management has hired a digital agency to design all-new mobile experience • Agency contracted to deliver functional prototype in four weeks • To be most impactful, must use real data and allow reservation booking
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Our Goals • Enable backend services for prototype experience • Keep up with our day job: • Services operations • Monolithic reservation application • Allow design to evolve
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. { "_id": 3, "name": "ElastiLodge South Zanetown", "image": "https://placehold.it/300x300.png", "description": "Sint nostrum vel quibusdam quia reprehenderit cum exercitationem quia ea.", "location": "South Zanetown", "manager": { "name": "Florentino Jacobi", "email": "florentino.jacobi@elastilodge.com" }, "timeZone": "US/Central", "phoneNumber": "802-918-3262", "category": 5, "address": { "street": "410 Simonis Forest", "zip": "07545-2308", "city": "South Zanetown", "country": "Virgin Islands, British" }, "deskHours": "24 hours", "amenities": [ ... ], "restaurants": [ ... ] } Legacy API: Sample Response
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Hotel Detail: Design • What data is required? • Can we use existing data sources? • How can we enable via AWS AppSync? • Challenges? Missing data?
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Mapping to Legacy API { "_id": 3, "image": "https://placehold.it/300x300.png", "name": "EL Resort & Spa", "description": "...", "location": "Fiji", "manager": { "name": "Florentino Jacobi", "email": "florentino.jacobi@elastilodge.com" }, "timeZone": "US/Central", "address": { "street": "123 Main St", ”postalcode": "07545", "city": "Momi Bay", "country": "Fiji" }, "phoneNumber": "1-888-123-4567", "category": 5, "deskHours": "24 hours", "amenities": [ ... ], "restaurants": [ ... ] }
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Mapping to Legacy API { "_id": 3, "image": "https://placehold.it/300x300.png", "name": "EL Resort & Spa", "description": "...", "location": "Fiji", "manager": { "name": "Florentino Jacobi", "email": "florentino.jacobi@elastilodge.com" }, "timeZone": "US/Central", "address": { "street": "123 Main St", ”postalcode": "07545", "city": "Momi Bay", "country": "Fiji" }, "phoneNumber": "1-888-123-4567", "category": 5, "deskHours": "24 hours", "amenities": [ ... ], "restaurants": [ ... ] }
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Hotel Detail: GraphQL Schema type Hotel { hotelId: ID! name: String! image: String location: String! phoneNumber: AWSPhone! address: Address! ... } type Query { listHotels(offset: String, limit: Int) getHotel(hotelId: ID!) }
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Hotel Detail: Resolvers ## Resolver: Request Mapping ## { "version": "2018-05-29", "method": "GET", "resourcePath": "/hotels/${ctx.args.hotelId}", "params": { "headers": { "Content-Type": "application/json" } }, } ## Resolver: Response Mapping ## #if($ctx.result.statusCode == 200) ## If response is 200, return the body. ## Could also filter result... $ctx.result.body #else ## If not 200, append response to error $utils.appendError($ctx.result.body) #end
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Hotel Detail: Result query { getHotel(hotelId: 3) { name location image phoneNumber address { street city } amenities } } { "name": "ElastiLodge North Rodgerstad", "location": "North Rodgerstad", "image": "https://placehold.it/300x300.png", "phoneNumber": "(214) 210-4674", "address": { "street": "123 Main St", "city": "North Rodgerstad" }, "amenities": [ ... ] }
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Reservations: Design • What data is required? • Can we use existing data sources? • How can we enable via AWS AppSync? • Challenges?
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Reservations: GraphQL Schema type Reservation { confirmationNumber: ID! hotel: Hotel! guest: User! startDate: AWSDate! endDate: AWSDate! rate: Int! } type Query { ... guestReservations:[Reservation] } type Mutation { createReservation(input: ReservationInput) deleteReservation(confNum: ID!) }
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Reservations: Query Resolver #set( $todayString = $util.time.nowISO8601().substring(0, 10) ) { "version": "2017-02-28", "operation": "Query", "query": { "expression": "guestId = :gId AND startDate > :startDate", "expressionValues": { ":gId": $util.dynamodb.toDynamoDBJson($ctx.identity.sub), ":startDate": $util.dynamodb.toDynamoDBJson($todayString) } } } Note: assumes user is logged in via AWS Cognito User Pool. Details are outside our scope.
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Reservations: Mutation Resolvers
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Reservations: Result query { guestReservations { confirmationNumber hotel { hotelId name image phoneNumber } startDate endDate } }
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Extending Reservation Workflow
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Adaptive Rates: Design • R&D is building an adaptive rate capability • Delivered via Amazon SageMaker API • How do we add today’s rate to our existing API?
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Adaptive Rates: Evolving our GraphQL API GraphQL supports multiple data sources per query: 1. Add new field 2. Configure new Data Source and Resolvers
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Adaptive Rates: GraphQL Types and Resolvers type Hotel { hotelId: ID! name: String! location: String! ... rate: Rate } type Rate { hotelId: ID! rate: Int! currency: String! date: AWSDate! } ## rate Field Resolver: Request Mapping ## { "version": "2018-05-29", "method": "GET", "resourcePath": "/rd/rates/${ctx.source.hotelId}", "params": { "headers": { "Content-Type": "application/json" } } }
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Adaptive Rates: Result query { getHotel(hotelId: 3) { name location image phoneNumber address { street city } amenities rate { currency rate } } } { "name": "ElastiLodge North Rodgerstad", "location": "North Rodgerstad", "image": "https://placehold.it/300x300.png", "phoneNumber": "(214) 210-4674", "address": { "street": "", "city": "" }, "amenities": [ ... ], "rate": { "currency": "USD", "rate": 312 } }
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What did we accomplish today? • Built a rich, flexible, mobile-ready API • Incorporated legacy, new, and prototype features in a single endpoint • Evolved API as requirements changed • No coding required! • Well, there were a few Velocity Templates • AWS console includes starter / boilerplate templates
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Extra Credit • Other design ideas? • A few of mine: • Add today’s weather in hotel location • Search for hotel by location, date, or rate • Search by geolocation • Allow users to upload photos
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Amplify CLI • Toolchain for developers • Enables you to prototype and build quickly • Built-in GraphQL Transformer • Converts schema to AWS CloudFormation templates and builds cloud resources $ amplify api add # create GraphQL schema # for example: type Hotel @model @searchable { name: String! location: String! ... } https://github.com/aws-amplify/amplify-cli
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Finished Solution https://github.com/jkahn117/reinvent2018-mob320
  • 38. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Josh Kahn jkahn@amazon.com
  • 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.