seattle aws - lambda@edge (serverless & originless on aws)

Download Seattle AWS - Lambda@Edge (Serverless & Originless on AWS)

Post on 21-Apr-2017

67 views

Category:

Technology

1 download

Embed Size (px)

TRANSCRIPT

  • clda.co/lambda-edge-sea.le

    AWS Lambda@Edge (Preview)

    Serverless & Originless on AWS

    4/17/2017

    http://clda.co/lambda-edge-seattle

  • About Me

    @alex_casalboni

    clda.co/lambda-edge-sea.le

    Computer Science Background

    Sr. SoDware Engineer & Web Developer

    Cloud Evangelist @ Cloud Academy

    Serverless Italy Meetup Co-Organizer

    http://clda.co/lambda-edge-seattlehttps://cloudacademy.com

  • Agenda

    What is Lambda@Edge?

    Benefits and use cases

    Preview & GA

    My personal experiment

    clda.co/lambda-edge-sea.le

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • What is Lambda@Edge?

    How does it work and hows it different from AWS Lambda?

    clda.co/lambda-edge-sea.le

    http://clda.co/lambda-edge-seattle

  • AWS Lambda & Regions

    us-east-1

    clda.co/lambda-edge-sea.le

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • AWS Lambda & Regions

    us-east-1 eu-west-1

    clda.co/lambda-edge-sea.le

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • AWSs CDN & PoPs

    70+ PoPs

    clda.co/lambda-edge-sea.le

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • Amazon CloudFront

    StaQc content (web assets, videos, etc.)

    Dynamic content (cache)

    70+ Edge LocaQons

    Custom SSL & domain name

    Cache InvalidaQon

    AnalyQcs dashboard

    Custom origins (e.g. EC2)

    Supports cookies & querystrings

    clda.co/lambda-edge-sea.le

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • Hits/Misses/Errors

    clda.co/lambda-edge-sea.le

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • Lambda@Edge Architecture

    clda.co/lambda-edge-sea.le

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • CloudFront Triggers

    Viewer Request

    Viewer Response

    Origin Request

    Origin Response

    Before cache hit/miss

    A8er cache hit/miss

    Only if cache miss, before forwarding

    Only if cache miss, a8er forwarding

    clda.co/lambda-edge-sea.le

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • Benefits and use cases

    Use cases categorisa@on and analysis

    clda.co/lambda-edge-sea.le

    http://clda.co/lambda-edge-seattle

  • AWS Lambda@Edge Use cases

    Request/Response manipulaQon

    Dynamic content generaQon

    Pure latency opQmizaQon

    clda.co/lambda-edge-sea.le

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • 1. Request/Response manipulaPon

    Custom HTTP headers

    Adapt to client capabiliQes

    Add Qmezone-related info

    A/B tesQng

    URL rewriQng / redirects

    EncrypQon at the Edge

    clda.co/lambda-edge-sea.le

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • 2. Dynamic content generaPon *

    Custom error pages

    Custom signup forms

    Opzimized JS code (Polyfill.io)

    Dynamic HTML

    * Never hit the origin!

    clda.co/lambda-edge-sea.le

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • 3. Pure latency opPmizaPon *

    401 errors (if missing auth)

    Edge-based logging

    Custom data validaQon

    Custom data transformaQon

    * Assuming dynamic origin

    clda.co/lambda-edge-sea.le

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • Preview & GA

    What about Preview limita@ons, GA, and pricing?

    clda.co/lambda-edge-sea.le

    http://clda.co/lambda-edge-seattle

  • LimitaPons (preview only)

    Max 50ms

    Only 128MB (RAM)

    Only 1MB of code

    Only Node.js 4.3

    Programming model Only 1 trigger

    clda.co/lambda-edge-sea.le

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • LimitaPons (permanent)

    Cold starts

    Only Node.js

    No VPC

    No API Gateway distribuQons

    Slow propagaQon (~5min)

    No real-Qme logging

    clda.co/lambda-edge-sea.le

    No DLQ Explicit HTTP convenQons

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • General Availability (soon!)

    HTTP calls / AWS SDK

    Dynamic Content!

    Be.er (3rd-party) monitoring

    More RAM, Qme, and storage

    clda.co/lambda-edge-sea.le

    MulQple triggers Be.er LocaQon awareness

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • Lambda@Edge Pricing

    $0.60 / 1M calls (requests)

    $1.00 / 3M calls (duraQon)

    No Free Tier

    50ms granularity

    clda.co/lambda-edge-sea.le

    Example: 6M calls ~ $5.6

    https://cloudacademy.comhttp://clda.co/lambda-edge-seattle

  • My personal experiment

    Finally some code :)

    clda.co/lambda-edge-sea.le

    http://clda.co/lambda-edge-seattle

  • Render dynamic HTML with Lambda@Edge

    < origin-less demo >

    clda.co/lambda-edge-gist

    clda.co/lambda-edge-demo

    clda.co/lambda-edge-sea.le

    https://cloudacademy.comhttps://d2qh7chuub32aw.cloudfront.nethttp://clda.co/lambda-edge-gisthttp://clda.co/lambda-edge-demohttp://clda.co/lambda-edge-seattle

  • Thank you =)

    Q & A

    4/17/2017 clda.co/lambda-edge-sea.le

    http://clda.co/lambda-edge-seattle

Recommended

View more >