Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Going Serverless: Event-Driven Architecture Without The Infrastructure

Going Serverless: Event-Driven Architecture Without The Infrastructure

Greg Shackles

October 08, 2016
Tweet

More Decks by Greg Shackles

Other Decks in Technology

Transcript

  1. EVOLUTION OF ENVIRONMENT ABSTRACTIONS Virtual Machines Containers Functions INFRASTRUCTURE HOST

    OS HYPERVISOR GUEST OS GUEST OS GUEST OS LIBS LIBS LIBS APP 1 APP 2 APP 3 INFRASTRUCTURE OS CONTAINER ENGINE LIBS LIBS LIBS APP 1 APP 2 APP 3
  2. FUNCTIONS WHAT ARE THEY? ▸ Stateless, event-driven operations ▸ No

    infrastructure to manage ▸ Scales on its own ▸ Only pay for time spent running
  3. IT IS SERVERLESS THE SAME WAY WIFI IS WIRELESS. Gojko

    Adzic WHAT’S IN A NAME? https://gojko.net/2016/08/27/serverless.html
  4. WHAT CAN TRIGGER A FUNCTION? EVENT SOURCES ▸ File uploaded

    ▸ Database changed ▸ Schedule ▸ Email received ▸ HTTP endpoint called ▸ Manual invocation ▸ …and so on
  5. WHAT CAN TRIGGER A FUNCTION? AWS LAMBDA ▸ S3 ▸

    DynamoDB ▸ Kinesis ▸ API Gateway ▸ Alexa ▸ SNS ▸ CloudWatch ▸ Schedule ▸ …and more
  6. WHAT CAN TRIGGER A FUNCTION? AZURE FUNCTIONS ▸ Blob Storage

    ▸ Event Hub ▸ Webhook ▸ GitHub webhook ▸ Queue ▸ ServiceBus Queue ▸ ServiceBus Topic ▸ Timer ▸ …and more
  7. FUNCTION ENVIRONMENT AWS LAMBDA ▸ Amazon Linux AMI 2015.09 ▸

    5 minute execution time limit ▸ Languages ▸ JavaScript ▸ Java ▸ Python
  8. FUNCTION ENVIRONMENT AZURE FUNCTIONS ▸ Runs on WebJobs (Windows Server

    2012) ▸ No execution time limit ▸ Languages ▸ JavaScript ▸ C# ▸ F# ▸ Python ▸ PHP ▸ Bash ▸ Batch ▸ PowerShell
  9. PRICING COMPARISON (MONTHLY) AWS LAMBDA ▸ Free ▸ 1M executions

    ▸ 400,000 GB-s ▸ Additional ▸ $0.20 / 1M executions ▸ $0.00001667 per GB-s AZURE FUNCTIONS ▸ Free ▸ 1M executions ▸ 400,000 GB-s ▸ Additional ▸ $0.20 / 1M executions ▸ $0.000008 per GB-s
  10. PRICING EXAMPLE 256MB memory, 3 million executions, 1s per execution

    3M * 1s * 256MB/1024 = 750,000 GB-s 750,000 GB-s - 400,000 free = 350,000 GB-s 350,000 * $0.00001667 = $5.83 AWS LAMBDA AZURE FUNCTIONS Compute 3M - 1M free = 2M requests 2M * $0.2 = $0.40 Request Monthly Total: $6.23 3M * 1s * 256MB/1024 = 750,000 GB-s 750,000 GB-s - 400,000 free = 350,000 GB-s 350,000 * $0.000008 = $2.80 Compute 3M - 1M free = 2M requests 2M * $0.2 = $0.40 Request Monthly Total: $3.20