build a server-less event-driven backend with aws lambda and amazon api gateway
TRANSCRIPT
Build a Server-less Event-driven Backendwith AWS Lambda and Amazon API Gateway
Danilo PocciaAWS Technical Evangelist
@danilopdanilop
Application
Files
DB
API Calls
Websites(JavaScript
Apps)
Mobile Apps
Wearable
Services
API Calls
JavaScript
API Calls
Application
Files
DB
API Calls
Websites(JavaScript
Apps)
Mobile Apps
Wearable
Services
API Calls
JavaScriptAuthentication& Authorization
Caching & Throttling
Business Logic
API Calls
Application
DB
API Calls
Websites(JavaScript
Apps)
Mobile Apps
Wearable
Services
API Calls
JavaScript
Files
AmazonS3
AmazonDynamoDB
Authentication & Authorization
AmazonCognito
Business Logic
AWSLambda
Caching & Throttling
Amazon APIGatewayAPI Calls
X
AuthenticationProviders
End Users
User Credentials
AuthenticationToken
Amazon CognitoIdentity Broker
Identity Pool Id(Token)
Identity IdAWS Temp Credentials
(Depending onAuth / Unauth Role)
Access toAWS Services
(Including AmazonAPI Gateway)
Identity IdAWS Temp Credentials
Amazon S3
AmazonDynamoDB
AmazonMobile Analytics
Amazon CognitoSync Store
K / V
Authentication & Authorization
AmazonCognitoCheck Token
X
End Users
User Credentials
AuthenticationToken
Amazon CognitoIdentity Broker
Identity Pool Id(Token)
Identity IdAWS Temp Credentials
(Depending onAuth / Unauth Role)
Access toAWS Services
(Including AmazonAPI Gateway)
Identity IdAWS Temp Credentials
Amazon S3
AmazonDynamoDB
AmazonMobile Analytics
Amazon CognitoSync Store
K / V
Custom Authentication
ServiceGet Token
Token Authentication & Authorization
AmazonCognito
AmazonCloudFront
API Gateway Cache
AmazonCloudWatch
Monitoring & Logs
Endpoints onAmazon EC2 or
AWS Elastic Beanstalk
Internet
Any other publicly accessible endpoint
AWS Lambda Functions
Caching & Throttling
Amazon APIGateway
X
Access toAPI Method
Managed Cache to Store API Responses
Reduced Latency and DDoS Protection through Amazon CloudFront
SDK Generation for iOS, Android and JavaScript
HTTP 429 Response for API Throttling (Managed by the SDK)
Swagger Support
Request / Response Data Transformation and API Mocking
Business Logic
AWSLambda
AWS Lambda Functions
AmazonAPI Gateway
Amazon S3
AmazonDynamoDB
Amazon CognitoSync Store
K / VAmazonSNS
AmazonKinesis
Alexa Skills Kit (ASK)Alexa Voice Service (AVS)
HTTPSInvoke
CustomEvents
HTTPSREST
API Call
Build Back-end Services that Perform at Scale
Respond Quickly to New Information
Run Your Code without Managing Infrastructure
Cost-effective and Efficient
Resource + HTTP Verb ➔ Method
/books + GET ➔ GetAllBooks
/books + POST ➔ CreateNewBook
/books/{id} + GET ➔ GetBookById
/books/{id} + PUT ➔ CreateOrUpdateBookById
/books/{id} + DELETE ➔ DeleteBookById
λ
λ λ
AmazonAPI Gateway
λ
λ
λλ
Bucket Usage Table
Media MetadataTable
User StatTable
User Location
Table
K / V
λ
λ
λ
Amazon CognitoIdentity Broker
Amazon CognitoSync Store
AmazonSNS
AmazonKinesis
Media Bucket
LogTable
Authentication &
AuthorizationUpload Picture / VideoUpdate Bucket UsageCheck Bucket Usage
Delete “Over Quota”
Media
Send Notification to
User / ApplicationExtract Metadata and
Write on DBUpdate
User StatisticsCall REST API
to Get Media Description
Upload Location Info
Update User Location
Look for Users or Media
Near Current Location
Call REST API to Get
User Info
Sync Media and User
RatingWrite
History of ChangesCheck and Update
Ratings
InvokeRead
Write / Send