build a server-less event-driven backend with aws lambda and amazon api gateway

Download Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway

Post on 18-Jan-2017

571 views

Category:

Software

0 download

Embed Size (px)

TRANSCRIPT

  • Build a Server-less Event-driven Backendwith AWS Lambda and Amazon API Gateway

    Danilo PocciaAWS Technical Evangelist

    @danilopdanilop

  • You Want to BuildYour Brand New Application

  • Application+

    Data

  • Application+

    Data

    Websites

    Mobile Apps

    Wearable

  • Application Data

    Websites

    Mobile Apps

    Wearable

  • Application

    Files

    DB

    Content +Some API Calls

    API Calls

    Websites

    Mobile Apps

    Wearable

  • Application

    Files

    DB

    API Calls

    Websites(JavaScript

    Apps)

    Mobile Apps

    Wearable

    JavaScript

    API Calls

  • 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

  • How Does It Works?

  • 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

  • Amazon API Gateway+

    AWS Lambda

  • Resource + HTTP Verb Method

  • Resource + HTTP Verb Method

    /books + GET GetAllBooks

  • Resource + HTTP Verb Method

    /books + GET GetAllBooks

    /books + POST CreateNewBook

  • Resource + HTTP Verb Method

    /books + GET GetAllBooks

    /books + POST CreateNewBook

    /books/{id} + GET GetBookById

    /books/{id} + PUT CreateOrUpdateBookById

    /books/{id} + DELETE DeleteBookById

  • Lets Put Everything Together

  • Media Sharing Application

  • 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

  • Microservice Architecture

  • Focus on You Idea

  • aws.amazon.com/free

    http://aws.amazon.com/free

  • Build a Server-less Event-driven Backendwith AWS Lambda and Amazon API Gateway

    Danilo PocciaAWS Technical Evangelist

    @danilopdanilop