“INTRODUCTION TO AWS LAMBDA WITH PYTHON” George Zografos akis@adaplo.com
Software Engineer at “An advertising automation solution for ecommerce stores”
Agenda 1. About AWS Lambda 2. Getting Started 3. Benefits vs. Drawbacks 4. Use Cases 5. Useful Information 6. Python Demo
About AWS Lambda
⬡ AWS Lambda lets you run code without provisioning or managing servers. You pay only for the compute time you consume - there is no charge when your code is not running. With Lambda, you can run code for virtually any type of application or backend service - all with zero administration. — According to AWS Developer Guide AWS Lambda
Serverless are applications where some amount of server-side logic is written by the application developer but is run in stateless compute containers that are event-triggered, ephemeral, and fully managed by a third party. Serverless is also called Function As A Service (FaaS). — According to Martin Fowler Serverless
How does Serverless help? It helps developers focus on the core business problem and reduces the amount of code they need to write by abolishing the need to run servers and manage infrastructure.
Getting Started
Log in to AWS
Go To Lambda
Create your function
Execute the lambda function
1. HTTP POST request 2. AWS CLI 3. Python boto3 library 4. Different types of event sources from other AWS resources (API Gateway, S3, Kinesis, SNS, Cloudwatch Logs/Events) Lambda function event sources
Benefits vs. Drawbacks
Built-in fault tolerance No infrastructure to manage Scale automatically up or down Pay only for what you use Extend AWS services with custom logic Benefits
1. Lock into AWS ecosystem 2. New tech that is not battled tested throughout history 3. Long running task that cannot be split into smaller subtasks 4. Non customizable execution environment 5. Not ideal for complex computations with high resource requirements Drawbacks
Use Cases
API Gateway Example 1 - API Backend Lambda DynamoDB S3 1. Download static website 2. AJAX request to website 3. Proxy HTTP message 4. Get state from storage
Example 2 - Image Compression LambdaS3 1. User uploads photo 2. Notify that photo has been uploaded 3. Process photo and store result S3
CloudWatch Event Example 3 - Cron Management Lambda Every 5 minutes CloudWatch Event Lambda Every 6 hours
Example 4 - Auxilliary FaaS LambdaServer 1. Register to website 3. Async Invoke Lambda 4. Send confirmation e-mail Mailchimp 2. Save to database Database
Example 5 - Data Pipeline Lambda Redshift 1. Send data 2. Filtered data 3. Transformed data Lambda
Useful Information
Case Studies
⬡ Google Cloud Functions ⬡ IBM OpenWhisk ⬡ Auth0 webtask.io ⬡ Azure Cloud Functions Alternatives
References ⬡ AWS Lambda documentation http://docs.aws.amazon.com/lambda/latest/dg/welcome.html?shortFooter=true ⬡ Awesome curated list of server less resources https://github.com/anaibol/awesome-serverless ⬡ Another list of awesome server less resources https://github.com/ServerlessHeroes/serverless-resources https://www.reddit.com/r/serverless/ https://martinfowler.com/articles/serverless.html
Questions ?
“PYTHON DEMO” George Zografos akis@adaplo.com Software Engineer @

Introduction to AWS Lambda with Python

  • 1.
    “INTRODUCTION TO AWS LAMBDAWITH PYTHON” George Zografos akis@adaplo.com
  • 2.
    Software Engineer at “Anadvertising automation solution for ecommerce stores”
  • 3.
    Agenda 1. About AWSLambda 2. Getting Started 3. Benefits vs. Drawbacks 4. Use Cases 5. Useful Information 6. Python Demo
  • 4.
  • 5.
    ⬡ AWS Lambdalets you run code without provisioning or managing servers. You pay only for the compute time you consume - there is no charge when your code is not running. With Lambda, you can run code for virtually any type of application or backend service - all with zero administration. — According to AWS Developer Guide AWS Lambda
  • 6.
    Serverless are applicationswhere some amount of server-side logic is written by the application developer but is run in stateless compute containers that are event-triggered, ephemeral, and fully managed by a third party. Serverless is also called Function As A Service (FaaS). — According to Martin Fowler Serverless
  • 7.
    How does Serverlesshelp? It helps developers focus on the core business problem and reduces the amount of code they need to write by abolishing the need to run servers and manage infrastructure.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
    1. HTTP POSTrequest 2. AWS CLI 3. Python boto3 library 4. Different types of event sources from other AWS resources (API Gateway, S3, Kinesis, SNS, Cloudwatch Logs/Events) Lambda function event sources
  • 14.
  • 15.
    Built-in fault tolerance No infrastructure tomanage Scale automatically up or down Pay only for what you use Extend AWS services with custom logic Benefits
  • 16.
    1. Lock intoAWS ecosystem 2. New tech that is not battled tested throughout history 3. Long running task that cannot be split into smaller subtasks 4. Non customizable execution environment 5. Not ideal for complex computations with high resource requirements Drawbacks
  • 17.
  • 18.
    API Gateway Example 1- API Backend Lambda DynamoDB S3 1. Download static website 2. AJAX request to website 3. Proxy HTTP message 4. Get state from storage
  • 19.
    Example 2 -Image Compression LambdaS3 1. User uploads photo 2. Notify that photo has been uploaded 3. Process photo and store result S3
  • 20.
    CloudWatch Event Example 3- Cron Management Lambda Every 5 minutes CloudWatch Event Lambda Every 6 hours
  • 21.
    Example 4 -Auxilliary FaaS LambdaServer 1. Register to website 3. Async Invoke Lambda 4. Send confirmation e-mail Mailchimp 2. Save to database Database
  • 22.
    Example 5 -Data Pipeline Lambda Redshift 1. Send data 2. Filtered data 3. Transformed data Lambda
  • 23.
  • 24.
  • 25.
    ⬡ Google CloudFunctions ⬡ IBM OpenWhisk ⬡ Auth0 webtask.io ⬡ Azure Cloud Functions Alternatives
  • 26.
    References ⬡ AWS Lambdadocumentation http://docs.aws.amazon.com/lambda/latest/dg/welcome.html?shortFooter=true ⬡ Awesome curated list of server less resources https://github.com/anaibol/awesome-serverless ⬡ Another list of awesome server less resources https://github.com/ServerlessHeroes/serverless-resources https://www.reddit.com/r/serverless/ https://martinfowler.com/articles/serverless.html
  • 27.
  • 28.

Editor's Notes

  • #17 Architectural patterns are not straightforward => a. Limited information, tooling & frameworks b.New tech stack that is not battled tested throughout history No easy way to shut the system down if required programming language/version is not supported Resource = memory and GPU