SlideShare a Scribd company logo
1 of 81
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Ed Lima – Solutions Architect, AWS
Vanessa Thornton – Senior Developer, Xero
October 2018
Developing and Implementing APIs at
Scale, the Serverless Way
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Agenda
• Building your API
• REST APIs and GraphQL APIs on AWS
• Securing your API
• Serverless API Backends with AWS Lambda
• Going Global with Serverless APIs
• Developer Tools
• Real world API at Scale use case with Xero
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
https://www.flickr.com/photos/arbron/7213225316
“Software is Eating the World” – Marc
Andreessen
“APIs are Eating Software” – Dr. Steve Willmott
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Building your
API
https://secure.flickr.com/photos/spenceyc/7481166880
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
InternetMobile/Web
apps
Databases/
Data stores
Basic API Technology Stack
Fail Over
Load Balancers
Web/Application Servers
Message Buses
Workers
?API
backend
?API
“server”
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
InternetMobile/Web
apps
AWS
Basic API Technology Stack
?API
backend
?API
“server”
Databases/
Data stores
Auto Scaling
Availability Zones
Fail Over
Load Balancers
Web/Application Servers
Message Buses
Workers
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
API Management Challenges
Managing multiple versions and stages of an API is difficult.
Monitoring third-party developers’ access is time consuming.
Access authorization is a challenge.
Traffic spikes create an operational burden.
Dealing with increased management overhead
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Introducing Amazon API Gateway
Create a unified
API front end for
multiple
microservices
Authenticate and
authorize
requests to a
backend
DDoS protection
and throttling
for your backend
Throttle, meter,
and monetize
API usage by
third-party
developers
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
?InternetMobile/Web
apps
AWS
Basic API Technology Stack - REST
API
backend
Databases/
Data stores
API Gateway
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Amazon API Gateway
API Gateway Integrations
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Mobile Apps
Websites
Services
Amazon API Gateway
API Gateway
Cache
Public
Endpoints on
Amazon EC2
Amazon
CloudWatch
Monitoring
All publicly
accessible
endpoints
Lambda
Functions
Endpoints
in VPC
Applications
& Services
in VPC
Any other
AWS service
Fully-managed
CloudFront
Distribution
Edge-OptimizedRegionalPrivate
Customer-managed
CloudFront
Distribution
Applications
& Services
in the same
AWS Region
AWS Direct
Connect
On-premises
API Gateway Integrations
NEW
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Mobile Apps
Websites
Services
Amazon API Gateway
API Gateway
Cache
Amazon
CloudWatch
Monitoring
Applications
& Services
in VPC
Fully-managed
CloudFront
Distribution
Edge-OptimizedRegionalPrivate
Customer-managed
CloudFront
Distribution
Applications
& Services
in the same
AWS Region
Public
Endpoints on
Amazon EC2
All publicly
accessible
endpoints
Lambda
Functions
Endpoints
in VPC
Any other
AWS service
AWS Direct
Connect
On-premises
API Gateway Backend Integrations
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
“A one size fits all database doesn’t fit anyone”
Werner Vogels
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
What Is GraphQL?
Describe what’s possible
with a type system
Uniform API across data stores
and APIs
Network optimized
requests and responses
Powerful developer tools Integrated
documentation and
introspection
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. Amazon Confidential and Trademark
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
Introducing AWS AppSync
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
?InternetMobile/Web
apps
AWS
Basic API Technology Stack - GraphQL
API
backend
AppSync
Databases/
Data stores
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AppSync Integrations
Internet
Mobile Apps
Websites
Services
AWS Lambda
functions
Amazon
DynamoDB
Amazon
CloudWatch
Monitoring
AWS AppSync
All publicly HTTP/S
accessible endpoints
Amazon
Elasticsearch
Amazon RDS
Amazon EC2
Any other
AWS service NEW
WebSockets
WebSockets
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Internet
Mobile Apps
Websites
Services
Amazon
CloudWatch
Monitoring
AWS AppSync
AppSync Backend Integrations
AWS Lambda
functions
Amazon
DynamoDB
All publicly HTTP/S
accessible endpoints
Amazon
Elasticsearch
Amazon RDS
Amazon EC2
Any other
AWS service NEW
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Internet
Mobile Apps
Websites
Services
Amazon
CloudWatch
Monitoring
AWS AppSync
AppSync Backend Integrations
AWS Lambda
functions
Amazon
DynamoDB
Amazon
Elasticsearch
Amazon RDS
Amazon EC2
Any other
AWS service
API
Gateway
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
InternetMobile/Web
apps
AWS
Databases/
Data stores
Basic API Serverless Technology Stack -
GraphQL
AWS Lambda
functions
AppSync
Amazon
DynamoDB
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Use GraphQL Use REST
When data drives UI
• Structured Data
• Complex Data
• Query-driven
• Real-time/Offline
Client-driven development
Pros: Contract-driven,
Introspection, Relations, Types
Conns: Not as ubiquitous as REST
When you leverage HTTP
• Caching
• Content Types
• Hypermedia (HATEOAS)
For Resources (e.g. Kinesis)
Pros: HTTP Client, Golden Standard,
HTTP/2 Performance gains
Conns: Over fetching/Under fetching
GraphQL or REST?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Bottom Line:
It depends on the use case and, most importantly…
GraphQL or REST?
Good API Design!
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
1. REST and GraphQL are totally different
2. GraphQL isn't a magic bullet, nor is it "better"
3. You can definitely use both at the same time
4. GraphQL is dope if used for the right thing
https://philsturgeon.uk/api/2017/01/24/graphql-vs-rest-overview/
“
”
GraphQL or REST?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Secure your
API
https://www.flickr.com/photos/modernrelics/1093797721/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Basic Serverless API Technology Stack
Places where we can secure our Application
InternetMobile/Web
apps
AWS
Databases/
Data stores
API Gateway AWS Lambda
functions
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Edge Security
InternetMobile/Web
apps
API Gateway
(Regional Endpoint)
Amazon
CloudFront
AWS WAF
https://aws.amazon.com/blogs/compute/protecting-your-api-using-amazon-api-gateway-and-aws-waf-part-i/
https://aws.amazon.com/blogs/compute/protecting-your-api-using-amazon-api-gateway-and-aws-waf-part-2/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Amazon API Gateway Security
Several mechanisms for adding AuthN/AuthZ to our API:
• IAM Permissions
• Use IAM policies and AWS credentials to grant access
• Custom Authorizers
• Use Lambda to validate a bearer token (OAuth or SAML as
examples) or request parameters and grant access
• Cognito User Pools
• Create a completely managed user management system
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS AppSync Security
Several mechanisms for adding AuthN/AuthZ to our API:
• IAM Permissions
• Use IAM policies and AWS credentials to grant access
• Cognito User Pools
• Create a completely managed user management system
• OpenID Connect (OIDC)
• External OpenID Connect provider
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Amazon
EC2
Amazon Elastic
Container Service (ECS)
Amazon EKS AWS FargateALBE/NLB
Auto Scaling
API Backend - AWS Compute Services
AWS
Lambda
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
InternetMobile/Web
apps
AWS
Databases/
Data stores
Basic API Serverless Technology Stack -
REST
API Gateway AWS Lambda
functions
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
No servers to provision
or manage
Scales with usage
Never pay for idle Availability and fault
tolerance built in
Serverless means…
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Infrastructure
Network
Machine / Instance
Operating System
Application
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Infrastructure
Network
Instance
Operating System
Application
AWS
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
SERVICES (ANYTHING)
Changes in
data state
Requests to
endpoints
Changes in
resource state
EVENT SOURCE FUNCTION
Node.js
Python
Java
C#
Go
Power Shell
Serverless Applications
NEW
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Lambda Execution Model
Synchronous (push) Asynchronous (event) Stream-based (pull)
Amazon
API Gateway
AWS Lambda
function
Amazon
DynamoDBAmazon
SNS
/order
AWS Lambda
function
Amazon
S3
reqs
Amazon
Kinesis
changes
AWS Lambda
service
function
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Amazon S3
Amazon DynamoDB
Amazon Kinesis Data Streams
Amazon Simple Notification Service
Amazon Simple Email Service
Amazon Simple Queue Service
Amazon Cognito
AWS CloudFormation
AWS AppSync
Lambda Event Sources
Amazon CloudWatch Logs
Amazon CloudWatch Events
AWS CodeCommit
Scheduled Events
AWS Config
Amazon Alexa
Amazon Lex
Amazon API Gateway
AWS IoT
Amazon CloudFront
Amazon Kinesis Data Firehose
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Lambda Event Sources
Amazon S3
Amazon DynamoDB
Amazon Kinesis Data Streams
Amazon Simple Notification Service
Amazon Simple Email Service
Amazon Simple Queue Service
Amazon Cognito
AWS CloudFormation
AWS AppSync
Amazon CloudWatch Logs
Amazon CloudWatch Events
AWS CodeCommit
Scheduled Events
AWS Config
Amazon Alexa
Amazon Lex
Amazon API Gateway
AWS IoT
Amazon CloudFront
Amazon Kinesis Data Firehose
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
1. Message inserted
into to a queue
message
Amazon
SQS
Lambda
function
3. Function
removes
message from
queue
2. Lambda polls
queue and
invokes function
Amazon SQS + Lambda
Simple, flexible, fully managed message
queuing service for reliably and
continuously exchanging any volume of
messages from anywhere
Processed in batches
At least once delivery
Visibility timeout allows for handling of
failures during processing
NEW
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Lambda
function
2. Lambda invoked
SNS
Topic
1. Data published to a topic
Data
Amazon SNS + Lambda
Simple, flexible, fully managed
publish/subscribe messaging and mobile
push notification service for high
throughput, highly reliable message
delivery
Messages are published to a Topic
Topics can have multiple subscribers
(fanout)
Messages can be filtered and only sent to
certain subscribers
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Lambda
function
2. Lambda polls
stream
Amazon
Kinesis
Stream
1. Data published to a
stream
3. Kinesis returns
stream data
Data
Amazon Kinesis Streams + Lambda
Fully managed, highly scalable service for
collecting and processing real-time data
streams for analytics and machine
learning
Stream consists of shards with a fixed
amount of capacity and throughput
Lambda receives batches and potentially
batches of batches
Can have different applications consuming
the same stream
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Going Global
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Global Active-Active Serverless APIs
https://read.acloud.guru/building-a-serverless-multi-region-active-active-backend-36f28bed4ecf
https://myglobal.api.com
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Global Active-Active Serverless APIs
https://read.acloud.guru/build-a-cost-effective-mobile-backend-for-scale-and-security-4c0c143e898c
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Where do you ..
https://secure.flickr.com/photos/stevendepolo/5749192025/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS CloudFormation
Declarative templates of your resources
Manages AWS resources based on dependencies
Manage with Source Control
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Meet
SAM!
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
SAM Template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
Handler: app.lambda_handler
Runtime: nodejs8.10
Events:
Add:
Type: Api
Properties:
Path: /
Method: get
Environment:
Variables:
TABLE_NAME: !Ref Table
Table:
Type: AWS::Serverless::SimpleTable
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
SAM Template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
Handler: app.lambda_handler
Runtime: nodejs8.10
Events:
Add:
Type: Api
Properties:
Path: /
Method: get
Environment:
Variables:
TABLE_NAME: !Ref Table
Table:
Type: AWS::Serverless::SimpleTable
Lambda Function
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
SAM Template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
Handler: app.lambda_handler
Runtime: nodejs8.10
Events:
Add:
Type: Api
Properties:
Path: /
Method: get
Environment:
Variables:
TABLE_NAME: !Ref Table
Table:
Type: AWS::Serverless::SimpleTable
API Gateway API
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
SAM Template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
Handler: app.lambda_handler
Runtime: nodejs8.10
Events:
Add:
Type: Api
Properties:
Path: /
Method: get
Environment:
Variables:
TABLE_NAME: !Ref Table
Table:
Type: AWS::Serverless::SimpleTable DynamoDB Table
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
SAM Commands: Easier Deployment
Package
•Creates a deployment package (.zip file)
•Uploads deployment package to an Amazon S3 Bucket
•Adds a CodeUri property with S3 URI
Deploy
•Calls CloudFormation ‘CreateChangeSet’ API
•Calls CloudFormation ‘ExecuteChangeSet’ API
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Transformed Template
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
AWS Amplify
CLI
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
APIGW
Lambda
DynamoDB
Amazon
DynamoDB
API Gateway AWS Lambda
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
GraphQL Transformer
type Post {
id: ID!
content: String
description: String
ups: Int
downs: Int
}
NEW
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
GraphQL Transformer
Amazon DynamoDB
type Post
@model {
id: ID!
content: String
description: String
ups: Int
downs: Int
}
createPost
readPost
updatePost
deletePost
AWS AppSync
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
GraphQL Transformer
Amazon DynamoDB
type Post
@model
@auth(rules:
[{allow: owner}]){
id: ID!
content: String
description: String
ups: Int
downs: Int
}
Amazon
Cognito
User Pools
mutations
queries
createPost
readPost
updatePost
deletePost
AWS AppSync
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
GraphQL Transformer
Amazon DynamoDB
type Post
@model
@auth(rules:
[{allow: owner}])
@searchable{
id: ID!
content: String
description: String
ups: Int
downs: Int
}
Amazon Elasticsearch
searchPosts
Amazon
Cognito
User Pools
mutations
queries
createPost
readPost
updatePost
deletePost
AWS AppSync
https://medium.com/open-graphql/create-a-multiuser-graphql-crud-l-app-in-10-minutes-with-the-new-aws-amplify-cli-and-in-a-few-73aef3d49545
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Local Development
SAM CLI (Node.js, Java, Python, Go, .NET Core)
Amplify CLI (Node.js)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
A Scalable Serverless API Use
Case
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Buildingserverless
applicationsat scale
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
The Challenge
Build asolution that handleslargeamountsof data, scalesat thedrop of ahat and also
reducestheload on our public API
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
● TheXero API serves115million callsper
week. That averagesout to be16
million callsaday.
● Alargenumber of callsinto theAPI are
HTTPGet requests. Creatinga‘polling
effect’.
● Thiscaused unnecessary load on our
gateway and upstream API’s.
● Thispattern wasnot sustainablenor
scalable.
The Problem
Picturecredits LornaMitchell
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
● Weneeded away to effortlessly scaleand respond to thepeaksand
troughsof dataflow
● Provideour appswith anotification when an end user makesachange
in near real-time.
● Follow industry standards, not re-invent thewheel.
Architecture Challenges
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
The Solution
Implement webhookson Xero’spublic API
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark“Don’t call us, we’ll call you!”
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
● Awebhook isaway to provide
applicationsdatain near real-timevia
HTTPpost.
● Dataimmediately arrivesafter a change
hasoccurred in theoriginatingsystem.
● Webhooksaremoreefficient for both
theprovider and theconsumer.
● Reduction in polling.
Webhooks
Picturecredits LornaMitchell
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
● Weneeded away to effortlessly scaleand respond to thepeaksand
troughsof dataflow
● Provideour appswith anotification when an end user makesachange
in near real-time.
● Follow industry standards, not re-invent thewheel.
Architecture Challenges
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Registering For Events
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Dispatching of Events
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Storage of Events
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Delivery of Events
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
● Weneeded away to effortlessly scaleand respond to thepeaksand
troughsof dataflow
● Provideour appswith anotification when an end user makesachange
in near real-time.
● Follow industry standards, not re-invent thewheel.
Architecture Challenges
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
● How to secureour payloads
● How do handle‘misbehavingapps’ so they don’t affect delivery and
causebottlenecks
● How do wehandleretriesfor unsuccessful deliveries
● PerformanceTesting
Development Challenges
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
● Wedeliver eventsto apps
within 10secondsof a
changeoccuringin Xero
● Wehaveover 470active
subscriptions
● Deliveringon average30
million eventsamonth/ 1.5
million webhook batches
How isit performing
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
● Updatingour delivery system to betriggered off SQSinstead of a
CloudWatch event timer.
● Moreevent types
● Support for MultipleURLs
What isnext?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Come join us across 6 cities in Australia and New Zealand for the Serverless Workshops: Wild Rydes!
Build an innovative unicorn transportation service using AWS Lambda, AWS Step Functions, Amazon DynamoDB,
Amazon API Gateway, and Amazon Kinesis to get people to their destination faster and hassle-free. Challenge yourself with your
peers and enjoy a free day of learning, food and networking.
Register (spots are limited in each city): https://splashthat.com/sites/view/aws-serverlessworkshop-wildrydes.splashthat.com
23 Oct: Perth
25 Oct: Auckland
26 Oct: Wellington
29 Oct: Melbourne
30 Oct: Brisbane
30 Oct: Sydney
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Q&A
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Thank you!

More Related Content

What's hot

What's hot (20)

Microservices for Startups
Microservices for StartupsMicroservices for Startups
Microservices for Startups
 
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
 
Serverless days Stockholm - How to build a full-stack airline ticketing web app
Serverless days Stockholm - How to build a full-stack airline ticketing web appServerless days Stockholm - How to build a full-stack airline ticketing web app
Serverless days Stockholm - How to build a full-stack airline ticketing web app
 
All the Ops you need to know to Dev Serverless
All the Ops you need to know to Dev ServerlessAll the Ops you need to know to Dev Serverless
All the Ops you need to know to Dev Serverless
 
The Future of API Management Is Serverless
The Future of API Management Is ServerlessThe Future of API Management Is Serverless
The Future of API Management Is Serverless
 
Intro to AWS Amplify Toolchain: Mobile Week SF
Intro to AWS Amplify Toolchain: Mobile Week SFIntro to AWS Amplify Toolchain: Mobile Week SF
Intro to AWS Amplify Toolchain: Mobile Week SF
 
Accelerating App Development with AWS Amplify
Accelerating App Development with AWS AmplifyAccelerating App Development with AWS Amplify
Accelerating App Development with AWS Amplify
 
Serverless APIs and you
Serverless APIs and youServerless APIs and you
Serverless APIs and you
 
ArmadaJS - how to build a full-stack airline ticketing web app
ArmadaJS - how to build a full-stack airline ticketing web appArmadaJS - how to build a full-stack airline ticketing web app
ArmadaJS - how to build a full-stack airline ticketing web app
 
Building with AWS Databases: Match Your Workload to the Right Database | AWS ...
Building with AWS Databases: Match Your Workload to the Right Database | AWS ...Building with AWS Databases: Match Your Workload to the Right Database | AWS ...
Building with AWS Databases: Match Your Workload to the Right Database | AWS ...
 
Developing and Implementing APIs at Scale, the Servless Way - Ed Lima - AWS T...
Developing and Implementing APIs at Scale, the Servless Way - Ed Lima - AWS T...Developing and Implementing APIs at Scale, the Servless Way - Ed Lima - AWS T...
Developing and Implementing APIs at Scale, the Servless Way - Ed Lima - AWS T...
 
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Developing Modern Applications in the Cloud
Developing Modern Applications in the CloudDeveloping Modern Applications in the Cloud
Developing Modern Applications in the Cloud
 
Building Mobile Apps with AWS Amplify
Building Mobile Apps with AWS AmplifyBuilding Mobile Apps with AWS Amplify
Building Mobile Apps with AWS Amplify
 
Building Private API’s for Security Automation at Monash University
Building Private API’s for Security Automation at Monash UniversityBuilding Private API’s for Security Automation at Monash University
Building Private API’s for Security Automation at Monash University
 
Developing & Testing Your Hybrid Mobile App with AWS MobileHUB & AWS Amplify ...
Developing & Testing Your Hybrid Mobile App with AWS MobileHUB & AWS Amplify ...Developing & Testing Your Hybrid Mobile App with AWS MobileHUB & AWS Amplify ...
Developing & Testing Your Hybrid Mobile App with AWS MobileHUB & AWS Amplify ...
 
Building and Deploying Your First Serverless Application
Building and Deploying Your First Serverless ApplicationBuilding and Deploying Your First Serverless Application
Building and Deploying Your First Serverless Application
 
Serverless and DevOps
Serverless and DevOpsServerless and DevOps
Serverless and DevOps
 
Kubernetes on AWS with Amazon EKS - MAD301 - New York AWS Summit
Kubernetes on AWS with Amazon EKS - MAD301 - New York AWS SummitKubernetes on AWS with Amazon EKS - MAD301 - New York AWS Summit
Kubernetes on AWS with Amazon EKS - MAD301 - New York AWS Summit
 

Similar to AWS Webinar Series - Developing and Implementing APIs at Scale

Similar to AWS Webinar Series - Developing and Implementing APIs at Scale (20)

Serverless applications with AWS
Serverless applications with AWSServerless applications with AWS
Serverless applications with AWS
 
Lessons Learned from Building an AWS Service on AWS Lambda (SRV327-R1) - AWS ...
Lessons Learned from Building an AWS Service on AWS Lambda (SRV327-R1) - AWS ...Lessons Learned from Building an AWS Service on AWS Lambda (SRV327-R1) - AWS ...
Lessons Learned from Building an AWS Service on AWS Lambda (SRV327-R1) - AWS ...
 
Building Mobile Apps with AWS Amplify
Building Mobile Apps with AWS AmplifyBuilding Mobile Apps with AWS Amplify
Building Mobile Apps with AWS Amplify
 
How to build a FullStack Airline Ticketing Web App.pdf
How to build a FullStack Airline Ticketing Web App.pdfHow to build a FullStack Airline Ticketing Web App.pdf
How to build a FullStack Airline Ticketing Web App.pdf
 
Building serverless enterprise applications - SRV315 - Toronto AWS Summit
Building serverless enterprise applications - SRV315 - Toronto AWS SummitBuilding serverless enterprise applications - SRV315 - Toronto AWS Summit
Building serverless enterprise applications - SRV315 - Toronto AWS Summit
 
Build Enterprise-Grade Serverless Apps - SRV315 - Chicago AWS Summit
Build Enterprise-Grade Serverless Apps - SRV315 - Chicago AWS SummitBuild Enterprise-Grade Serverless Apps - SRV315 - Chicago AWS Summit
Build Enterprise-Grade Serverless Apps - SRV315 - Chicago AWS Summit
 
Introduction to AWS Amplify and the Amplify CLI Toolchain
Introduction to AWS Amplify and the Amplify CLI ToolchainIntroduction to AWS Amplify and the Amplify CLI Toolchain
Introduction to AWS Amplify and the Amplify CLI Toolchain
 
Unlocking Agility with the AWS Serverless Application Model (SAM) - AWS Summi...
Unlocking Agility with the AWS Serverless Application Model (SAM) - AWS Summi...Unlocking Agility with the AWS Serverless Application Model (SAM) - AWS Summi...
Unlocking Agility with the AWS Serverless Application Model (SAM) - AWS Summi...
 
Building APIs with Amazon API Gateway
Building APIs with Amazon API GatewayBuilding APIs with Amazon API Gateway
Building APIs with Amazon API Gateway
 
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...
Building APIs with Amazon API Gateway: re:Invent 2018 Recap at the AWS Loft -...
 
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
 
Discuss How to Secure Your Virtual Data Center in the Cloud (NET210-R1) - AWS...
Discuss How to Secure Your Virtual Data Center in the Cloud (NET210-R1) - AWS...Discuss How to Secure Your Virtual Data Center in the Cloud (NET210-R1) - AWS...
Discuss How to Secure Your Virtual Data Center in the Cloud (NET210-R1) - AWS...
 
Beyond Infrastructure for SAP on AWS (GPSTEC322) - AWS re:Invent 2018
Beyond Infrastructure for SAP on AWS (GPSTEC322) - AWS re:Invent 2018Beyond Infrastructure for SAP on AWS (GPSTEC322) - AWS re:Invent 2018
Beyond Infrastructure for SAP on AWS (GPSTEC322) - AWS re:Invent 2018
 
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
 
Building secure APIs in the cloud - SDD403-R - AWS re:Inforce 2019
Building secure APIs in the cloud - SDD403-R - AWS re:Inforce 2019 Building secure APIs in the cloud - SDD403-R - AWS re:Inforce 2019
Building secure APIs in the cloud - SDD403-R - AWS re:Inforce 2019
 
GraphQL backend with AWS AppSync & AWS Lambda
GraphQL backend with AWS AppSync & AWS LambdaGraphQL backend with AWS AppSync & AWS Lambda
GraphQL backend with AWS AppSync & AWS Lambda
 
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) ...
 
善用 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)
 
Developing Serverless Application on AWS
Developing Serverless Application on AWSDeveloping Serverless Application on AWS
Developing Serverless Application on AWS
 
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
 

More from Amazon 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 AWS
Amazon 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 Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon 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
 

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
 
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
 
Come costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSCome costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWS
 

AWS Webinar Series - Developing and Implementing APIs at Scale

  • 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Ed Lima – Solutions Architect, AWS Vanessa Thornton – Senior Developer, Xero October 2018 Developing and Implementing APIs at Scale, the Serverless Way
  • 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Agenda • Building your API • REST APIs and GraphQL APIs on AWS • Securing your API • Serverless API Backends with AWS Lambda • Going Global with Serverless APIs • Developer Tools • Real world API at Scale use case with Xero
  • 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark https://www.flickr.com/photos/arbron/7213225316 “Software is Eating the World” – Marc Andreessen “APIs are Eating Software” – Dr. Steve Willmott
  • 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Building your API https://secure.flickr.com/photos/spenceyc/7481166880
  • 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark InternetMobile/Web apps Databases/ Data stores Basic API Technology Stack Fail Over Load Balancers Web/Application Servers Message Buses Workers ?API backend ?API “server”
  • 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark InternetMobile/Web apps AWS Basic API Technology Stack ?API backend ?API “server” Databases/ Data stores Auto Scaling Availability Zones Fail Over Load Balancers Web/Application Servers Message Buses Workers
  • 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark API Management Challenges Managing multiple versions and stages of an API is difficult. Monitoring third-party developers’ access is time consuming. Access authorization is a challenge. Traffic spikes create an operational burden. Dealing with increased management overhead
  • 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Introducing Amazon API Gateway Create a unified API front end for multiple microservices Authenticate and authorize requests to a backend DDoS protection and throttling for your backend Throttle, meter, and monetize API usage by third-party developers
  • 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ?InternetMobile/Web apps AWS Basic API Technology Stack - REST API backend Databases/ Data stores API Gateway
  • 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon API Gateway API Gateway Integrations
  • 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Mobile Apps Websites Services Amazon API Gateway API Gateway Cache Public Endpoints on Amazon EC2 Amazon CloudWatch Monitoring All publicly accessible endpoints Lambda Functions Endpoints in VPC Applications & Services in VPC Any other AWS service Fully-managed CloudFront Distribution Edge-OptimizedRegionalPrivate Customer-managed CloudFront Distribution Applications & Services in the same AWS Region AWS Direct Connect On-premises API Gateway Integrations NEW
  • 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Mobile Apps Websites Services Amazon API Gateway API Gateway Cache Amazon CloudWatch Monitoring Applications & Services in VPC Fully-managed CloudFront Distribution Edge-OptimizedRegionalPrivate Customer-managed CloudFront Distribution Applications & Services in the same AWS Region Public Endpoints on Amazon EC2 All publicly accessible endpoints Lambda Functions Endpoints in VPC Any other AWS service AWS Direct Connect On-premises API Gateway Backend Integrations
  • 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark “A one size fits all database doesn’t fit anyone” Werner Vogels
  • 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What Is GraphQL? Describe what’s possible with a type system Uniform API across data stores and APIs Network optimized requests and responses Powerful developer tools Integrated documentation and introspection Query language for your API and a runtime for fulfilling queries with existing data
  • 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 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 Introducing AWS AppSync
  • 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ?InternetMobile/Web apps AWS Basic API Technology Stack - GraphQL API backend AppSync Databases/ Data stores
  • 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AppSync Integrations Internet Mobile Apps Websites Services AWS Lambda functions Amazon DynamoDB Amazon CloudWatch Monitoring AWS AppSync All publicly HTTP/S accessible endpoints Amazon Elasticsearch Amazon RDS Amazon EC2 Any other AWS service NEW WebSockets WebSockets
  • 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Internet Mobile Apps Websites Services Amazon CloudWatch Monitoring AWS AppSync AppSync Backend Integrations AWS Lambda functions Amazon DynamoDB All publicly HTTP/S accessible endpoints Amazon Elasticsearch Amazon RDS Amazon EC2 Any other AWS service NEW
  • 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Internet Mobile Apps Websites Services Amazon CloudWatch Monitoring AWS AppSync AppSync Backend Integrations AWS Lambda functions Amazon DynamoDB Amazon Elasticsearch Amazon RDS Amazon EC2 Any other AWS service API Gateway
  • 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark InternetMobile/Web apps AWS Databases/ Data stores Basic API Serverless Technology Stack - GraphQL AWS Lambda functions AppSync Amazon DynamoDB
  • 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Use GraphQL Use REST When data drives UI • Structured Data • Complex Data • Query-driven • Real-time/Offline Client-driven development Pros: Contract-driven, Introspection, Relations, Types Conns: Not as ubiquitous as REST When you leverage HTTP • Caching • Content Types • Hypermedia (HATEOAS) For Resources (e.g. Kinesis) Pros: HTTP Client, Golden Standard, HTTP/2 Performance gains Conns: Over fetching/Under fetching GraphQL or REST?
  • 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Bottom Line: It depends on the use case and, most importantly… GraphQL or REST? Good API Design!
  • 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 1. REST and GraphQL are totally different 2. GraphQL isn't a magic bullet, nor is it "better" 3. You can definitely use both at the same time 4. GraphQL is dope if used for the right thing https://philsturgeon.uk/api/2017/01/24/graphql-vs-rest-overview/ “ ” GraphQL or REST?
  • 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Secure your API https://www.flickr.com/photos/modernrelics/1093797721/
  • 25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Basic Serverless API Technology Stack Places where we can secure our Application InternetMobile/Web apps AWS Databases/ Data stores API Gateway AWS Lambda functions
  • 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Edge Security InternetMobile/Web apps API Gateway (Regional Endpoint) Amazon CloudFront AWS WAF https://aws.amazon.com/blogs/compute/protecting-your-api-using-amazon-api-gateway-and-aws-waf-part-i/ https://aws.amazon.com/blogs/compute/protecting-your-api-using-amazon-api-gateway-and-aws-waf-part-2/
  • 27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon API Gateway Security Several mechanisms for adding AuthN/AuthZ to our API: • IAM Permissions • Use IAM policies and AWS credentials to grant access • Custom Authorizers • Use Lambda to validate a bearer token (OAuth or SAML as examples) or request parameters and grant access • Cognito User Pools • Create a completely managed user management system
  • 28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS AppSync Security Several mechanisms for adding AuthN/AuthZ to our API: • IAM Permissions • Use IAM policies and AWS credentials to grant access • Cognito User Pools • Create a completely managed user management system • OpenID Connect (OIDC) • External OpenID Connect provider
  • 29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon EC2 Amazon Elastic Container Service (ECS) Amazon EKS AWS FargateALBE/NLB Auto Scaling API Backend - AWS Compute Services AWS Lambda
  • 30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark InternetMobile/Web apps AWS Databases/ Data stores Basic API Serverless Technology Stack - REST API Gateway AWS Lambda functions
  • 31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark No servers to provision or manage Scales with usage Never pay for idle Availability and fault tolerance built in Serverless means…
  • 32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Infrastructure Network Machine / Instance Operating System Application
  • 33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Infrastructure Network Instance Operating System Application AWS
  • 34. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SERVICES (ANYTHING) Changes in data state Requests to endpoints Changes in resource state EVENT SOURCE FUNCTION Node.js Python Java C# Go Power Shell Serverless Applications NEW
  • 35. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Lambda Execution Model Synchronous (push) Asynchronous (event) Stream-based (pull) Amazon API Gateway AWS Lambda function Amazon DynamoDBAmazon SNS /order AWS Lambda function Amazon S3 reqs Amazon Kinesis changes AWS Lambda service function
  • 36. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon S3 Amazon DynamoDB Amazon Kinesis Data Streams Amazon Simple Notification Service Amazon Simple Email Service Amazon Simple Queue Service Amazon Cognito AWS CloudFormation AWS AppSync Lambda Event Sources Amazon CloudWatch Logs Amazon CloudWatch Events AWS CodeCommit Scheduled Events AWS Config Amazon Alexa Amazon Lex Amazon API Gateway AWS IoT Amazon CloudFront Amazon Kinesis Data Firehose
  • 37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Lambda Event Sources Amazon S3 Amazon DynamoDB Amazon Kinesis Data Streams Amazon Simple Notification Service Amazon Simple Email Service Amazon Simple Queue Service Amazon Cognito AWS CloudFormation AWS AppSync Amazon CloudWatch Logs Amazon CloudWatch Events AWS CodeCommit Scheduled Events AWS Config Amazon Alexa Amazon Lex Amazon API Gateway AWS IoT Amazon CloudFront Amazon Kinesis Data Firehose
  • 38. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 1. Message inserted into to a queue message Amazon SQS Lambda function 3. Function removes message from queue 2. Lambda polls queue and invokes function Amazon SQS + Lambda Simple, flexible, fully managed message queuing service for reliably and continuously exchanging any volume of messages from anywhere Processed in batches At least once delivery Visibility timeout allows for handling of failures during processing NEW
  • 39. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Lambda function 2. Lambda invoked SNS Topic 1. Data published to a topic Data Amazon SNS + Lambda Simple, flexible, fully managed publish/subscribe messaging and mobile push notification service for high throughput, highly reliable message delivery Messages are published to a Topic Topics can have multiple subscribers (fanout) Messages can be filtered and only sent to certain subscribers
  • 40. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Lambda function 2. Lambda polls stream Amazon Kinesis Stream 1. Data published to a stream 3. Kinesis returns stream data Data Amazon Kinesis Streams + Lambda Fully managed, highly scalable service for collecting and processing real-time data streams for analytics and machine learning Stream consists of shards with a fixed amount of capacity and throughput Lambda receives batches and potentially batches of batches Can have different applications consuming the same stream
  • 41. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Going Global
  • 42. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Global Active-Active Serverless APIs https://read.acloud.guru/building-a-serverless-multi-region-active-active-backend-36f28bed4ecf https://myglobal.api.com
  • 43. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Global Active-Active Serverless APIs https://read.acloud.guru/build-a-cost-effective-mobile-backend-for-scale-and-security-4c0c143e898c
  • 44. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Where do you .. https://secure.flickr.com/photos/stevendepolo/5749192025/
  • 45. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS CloudFormation Declarative templates of your resources Manages AWS resources based on dependencies Manage with Source Control
  • 46. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Meet SAM!
  • 47. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SAM Template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: Handler: app.lambda_handler Runtime: nodejs8.10 Events: Add: Type: Api Properties: Path: / Method: get Environment: Variables: TABLE_NAME: !Ref Table Table: Type: AWS::Serverless::SimpleTable
  • 48. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SAM Template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: Handler: app.lambda_handler Runtime: nodejs8.10 Events: Add: Type: Api Properties: Path: / Method: get Environment: Variables: TABLE_NAME: !Ref Table Table: Type: AWS::Serverless::SimpleTable Lambda Function
  • 49. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SAM Template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: Handler: app.lambda_handler Runtime: nodejs8.10 Events: Add: Type: Api Properties: Path: / Method: get Environment: Variables: TABLE_NAME: !Ref Table Table: Type: AWS::Serverless::SimpleTable API Gateway API
  • 50. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SAM Template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: Handler: app.lambda_handler Runtime: nodejs8.10 Events: Add: Type: Api Properties: Path: / Method: get Environment: Variables: TABLE_NAME: !Ref Table Table: Type: AWS::Serverless::SimpleTable DynamoDB Table
  • 51. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SAM Commands: Easier Deployment Package •Creates a deployment package (.zip file) •Uploads deployment package to an Amazon S3 Bucket •Adds a CodeUri property with S3 URI Deploy •Calls CloudFormation ‘CreateChangeSet’ API •Calls CloudFormation ‘ExecuteChangeSet’ API
  • 52. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Transformed Template
  • 53. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Amplify CLI
  • 54. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark APIGW Lambda DynamoDB Amazon DynamoDB API Gateway AWS Lambda
  • 55. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
  • 56. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark GraphQL Transformer type Post { id: ID! content: String description: String ups: Int downs: Int } NEW
  • 57. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark GraphQL Transformer Amazon DynamoDB type Post @model { id: ID! content: String description: String ups: Int downs: Int } createPost readPost updatePost deletePost AWS AppSync
  • 58. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark GraphQL Transformer Amazon DynamoDB type Post @model @auth(rules: [{allow: owner}]){ id: ID! content: String description: String ups: Int downs: Int } Amazon Cognito User Pools mutations queries createPost readPost updatePost deletePost AWS AppSync
  • 59. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark GraphQL Transformer Amazon DynamoDB type Post @model @auth(rules: [{allow: owner}]) @searchable{ id: ID! content: String description: String ups: Int downs: Int } Amazon Elasticsearch searchPosts Amazon Cognito User Pools mutations queries createPost readPost updatePost deletePost AWS AppSync https://medium.com/open-graphql/create-a-multiuser-graphql-crud-l-app-in-10-minutes-with-the-new-aws-amplify-cli-and-in-a-few-73aef3d49545
  • 60. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Local Development SAM CLI (Node.js, Java, Python, Go, .NET Core) Amplify CLI (Node.js)
  • 61. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark A Scalable Serverless API Use Case
  • 62. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Buildingserverless applicationsat scale
  • 63. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark The Challenge Build asolution that handleslargeamountsof data, scalesat thedrop of ahat and also reducestheload on our public API
  • 64. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ● TheXero API serves115million callsper week. That averagesout to be16 million callsaday. ● Alargenumber of callsinto theAPI are HTTPGet requests. Creatinga‘polling effect’. ● Thiscaused unnecessary load on our gateway and upstream API’s. ● Thispattern wasnot sustainablenor scalable. The Problem Picturecredits LornaMitchell
  • 65. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ● Weneeded away to effortlessly scaleand respond to thepeaksand troughsof dataflow ● Provideour appswith anotification when an end user makesachange in near real-time. ● Follow industry standards, not re-invent thewheel. Architecture Challenges
  • 66. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark The Solution Implement webhookson Xero’spublic API
  • 67. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark“Don’t call us, we’ll call you!”
  • 68. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ● Awebhook isaway to provide applicationsdatain near real-timevia HTTPpost. ● Dataimmediately arrivesafter a change hasoccurred in theoriginatingsystem. ● Webhooksaremoreefficient for both theprovider and theconsumer. ● Reduction in polling. Webhooks Picturecredits LornaMitchell
  • 69. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ● Weneeded away to effortlessly scaleand respond to thepeaksand troughsof dataflow ● Provideour appswith anotification when an end user makesachange in near real-time. ● Follow industry standards, not re-invent thewheel. Architecture Challenges
  • 70. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Registering For Events
  • 71. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Dispatching of Events
  • 72. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Storage of Events
  • 73. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Delivery of Events
  • 74. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ● Weneeded away to effortlessly scaleand respond to thepeaksand troughsof dataflow ● Provideour appswith anotification when an end user makesachange in near real-time. ● Follow industry standards, not re-invent thewheel. Architecture Challenges
  • 75. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ● How to secureour payloads ● How do handle‘misbehavingapps’ so they don’t affect delivery and causebottlenecks ● How do wehandleretriesfor unsuccessful deliveries ● PerformanceTesting Development Challenges
  • 76. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ● Wedeliver eventsto apps within 10secondsof a changeoccuringin Xero ● Wehaveover 470active subscriptions ● Deliveringon average30 million eventsamonth/ 1.5 million webhook batches How isit performing
  • 77. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ● Updatingour delivery system to betriggered off SQSinstead of a CloudWatch event timer. ● Moreevent types ● Support for MultipleURLs What isnext?
  • 78. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
  • 79. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Come join us across 6 cities in Australia and New Zealand for the Serverless Workshops: Wild Rydes! Build an innovative unicorn transportation service using AWS Lambda, AWS Step Functions, Amazon DynamoDB, Amazon API Gateway, and Amazon Kinesis to get people to their destination faster and hassle-free. Challenge yourself with your peers and enjoy a free day of learning, food and networking. Register (spots are limited in each city): https://splashthat.com/sites/view/aws-serverlessworkshop-wildrydes.splashthat.com 23 Oct: Perth 25 Oct: Auckland 26 Oct: Wellington 29 Oct: Melbourne 30 Oct: Brisbane 30 Oct: Sydney
  • 80. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Q&A
  • 81. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Thank you!