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

Building a serverless cloud service

Building a serverless cloud service

Serverless is a cloud architecture for executing code on-demand,
without running any application servers or managing any server
infrastructure. In this talk, we're taking a look at how to build a
cloud service in a serverless fashion using Python, AWS API Gateway,
and AWS Lambda.

John Chang is a co-founder and principal engineer at SURFnCODE, a
startup-that-creates-startups based in Matosinhos. Before coming to
Portugal, John worked for more than 15 years in senior software
engineering positions at Apple in California and Skype and Microsoft
in Europe.

Python Porto

November 28, 2018
Tweet

More Decks by Python Porto

Other Decks in Programming

Transcript

  1. A Little Context Heroku Google App Engine AWS EB PaaS

    IaaS 2015 2010 2005 2000 ☁ AWS EC2
  2. A Little Context Heroku Google App Engine AWS EB FaaS

    AWS Lambda GC Functions Azure Functions 2015 2010 2005 2000 PaaS IaaS ☁ AWS EC2
  3. • Serverless Computation == FaaS • … also Serverless Databases

    • “Serverless” means transparent scaling What is Serverless? FaaS AWS Lambda GC Functions Azure Functions
  4. So What? • Zero admin • Truly transparent scaling •

    No vendor lock-in • Lower costs ☁ { }
  5. FaaS Pricing • Billed by 1) GB-second rate + 2)

    Cost per request • 128 MB × (1 GB/1024 MB) × 100 ms × (1 s/1000 ms) = 0.0125 GB-s • 400,000 GB-s, 1M requests free per month
  6. • More abstraction • More systems complexity • Latency •

    Vendor lock-in (sort of…) So What? • Zero admin • Transparent scaling • No vendor lock-in • Lower costs ☁ { }
  7. FaaS Platforms AWS Lambda Supported Python 2.7, 3.6, 3.7 ✅

    Google Cloud Functions Beta Python 3.7.1 ⚠ Azure Functions Experimental (1.x), N/A (2.x)
  8. Ex: Lunchbot Action Lambda Event Post to Slack webhook Scrape

    Instagram, Build notification Daily timer { }
  9. Ex: Newsbot Action Lambda Event Post to backend Query news

    feeds and apply filters Hourly timer { }
  10. Ex: Server Health Alarms Action Lambda Event Post to Slack

    webhook Build notification Environment health check { }
  11. Data Pipeline • Real-time log/file/media processing • e.g. resize and

    compress image upon upload Lambda Sink Storage Source { }
  12. Ex: Server Log Analytics • Can be used with AWS

    Athena (“serverless” SQL) Lambda Sink Storage Source Parse user agent strings Post to Kinesis Firehose Web server access logs Write to S3 { }
  13. Ex: Proxy Backend Lambda API Gateway Data Store Client Rewrite

    responses Listen for requests Web app frontend Third-party API service { }
  14. Ex: Lunchbot Action Lambda Event Post to Slack webhook Scrape

    Instagram, Build notification Daily timer { }
  15. • Serverless Computation == FaaS • … also Serverless Databases

    • “Serverless” means transparent scaling What is Serverless? FaaS AWS Lambda GC Functions Azure Functions
  16. What is SURFnCODE? • Startup-that-makes-startups • Based in Matosinhos •

    *+,-./012345 • We’re hiring! 6 careers.surfncode.io (even Python newbies)