Going Serverless: Event-Driven Architecture Without The Infrastructure

Going Serverless: Event-Driven Architecture Without The Infrastructure

279b474d14f72e4daa1fc76e6f3c929f?s=128

Greg Shackles

October 08, 2016
Tweet

Transcript

  1. GOING SERVERLESS EVENT-DRIVEN ARCHITECTURE WITHOUT THE INFRASTRUCTURE Greg Shackles Principal

    Engineer, Olo @gshackles gregshackles.com
  2. 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
  3. ALL ABOARD THE HYPE TRAIN

  4. Utilization Time Load Capacity UNDER UTILIZED OVER UTILIZED

  5. FUNCTIONS WHAT ARE THEY? ▸ Stateless, event-driven operations ▸ No

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

    Adzic WHAT’S IN A NAME? https://gojko.net/2016/08/27/serverless.html
  7. LET’S TALK ABOUT THESE EVENTS SOUND TOO SIMPLE FOR REAL

    APPS?
  8. WHAT CAN TRIGGER A FUNCTION? EVENT SOURCES ▸ File uploaded

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

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

    ▸ Event Hub ▸ Webhook ▸ GitHub webhook ▸ Queue ▸ ServiceBus Queue ▸ ServiceBus Topic ▸ Timer ▸ …and more
  11. EXAMPLE USE CASES

  12. IMAGE RESIZING

  13. DATA WAREHOUSE ETL

  14. MOBILE BACKEND FOR SOCIAL MEDIA APP

  15. FUNCTION ENVIRONMENT AWS LAMBDA ▸ Amazon Linux AMI 2015.09 ▸

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

    2012) ▸ No execution time limit ▸ Languages ▸ JavaScript ▸ C# ▸ F# ▸ Python ▸ PHP ▸ Bash ▸ Batch ▸ PowerShell
  17. 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
  18. 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
  19. REAL WORLD CASE STUDIES

  20. https://fmlnerd.com/2016/08/16/30k-page-views-for-0-21-a-serverless-story/

  21. http://benchling.engineering/crispr-aws-lambda/

  22. IT’S NOT JUST AMAZON AND MICROSOFT EVERYBODY’S DOING IT IBM

    OpenWhisk …and others
  23. LET’S WRITE SOME FUNCTIONS

  24. QUESTIONS? Greg Shackles Principal Engineer, Olo @gshackles gregshackles.com