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

AWS Lambda

AWS Lambda

Serverless, event-driven compute service

Julian Kleinhans

June 09, 2017
Tweet

More Decks by Julian Kleinhans

Other Decks in Technology

Transcript

  1. 1 09.06.17
    AWS Lambda
    Serverless, event-driven compute service
    09.06.2017, AOE Internal Meetup, Julian Kleinhans

    View full-size slide

  2. 2 09.06.17
    Julian Kleinhans
    Software Architect @ AOE GmbH
    Standort Krefeld, NRW
    @kj187

    View full-size slide

  3. 3 09.06.17
    What is AWS Lambda
    Serverless compute service
    Introduced by Amazon in November 2014

    View full-size slide

  4. 4 09.06.17
    What means serverless
    Serverless = no servers ?

    View full-size slide

  5. 5 09.06.17
    What means serverless
    NO, there are servers
    But someone else is responsible
    Cloud Provider

    View full-size slide

  6. 6 09.06.17
    Goal behind serverless
    Primarily focus on code
    Not infrastructure
    Capacity, Scaling, Monitoring, Logging, Security Patching ...

    View full-size slide

  7. 7 09.06.17
    Replace serverless with ...
    FaaS
    Function as a service
    CoD
    Code on demand

    View full-size slide

  8. 8 09.06.17
    Flow
    Changes in data state
    Request to endpoints
    Changes in resource state
    Event source Function Services (anything)
    Change/Add data state
    Trigger AWS resource
    Call HTTP endpoint
    Your Code

    View full-size slide

  9. 9 09.06.17
    Events
    Event Sources
    Event sources that trigger AWS Lambda
    • Amazon S3
    • Amazon DynamoDb
    • Amazon Kinesis
    • Amazon API Gateway (REST API)
    • On Demand via SDK
    • ...
    approx. 16-17 services

    View full-size slide

  10. 10 09.06.17
    Function
    Write
    single-purpose
    stateless functions
    single responsibility principle

    View full-size slide

  11. 11 09.06.17
    Function
    Runtimes
    NodeJS 4.3 & 6.10
    Java 8
    Python 2.7
    C#

    View full-size slide

  12. 12 09.06.17
    Function
    ZIP Package
    handler-xyz.js
    node_modules/*
    Terraform example
    resource "aws_lambda_function" "lambda_nodejs_example" {
    filename = “directory/example-nodejs-lambda.zip"
    function_name = "example_nodejs_lambda"
    handler = ”handler-xyz.handler"
    runtime = "nodejs6.10"
    }

    View full-size slide

  13. 13 09.06.17
    Use Case
    1
    2
    3
    4
    Store image in S3
    Lambda Event Trigger
    Create thumbnail
    Store thumbnail in S3

    View full-size slide

  14. 14 09.06.17
    Use Case
    E-Mail DeskPro Middleware TargetProcess
    API Gateway
    Create bug ticket
    Close ticket
    Create ticket Webhook
    Event source Lambda
    DeskPro -> TargetProcess (fully automated)

    View full-size slide

  15. 15 09.06.17
    Limits
    Maximum execution duration per request
    => 300 seconds
    Alternative S3 Storage
    Lambda function deployment package size (.zip/.jar file)
    => 50 MB
    100 concurrent executions
    1.000 invokes per second
    Increases available via AWS customer service

    View full-size slide

  16. 16 09.06.17
    Costs
    1 million requests and
    400,000 GB-second of compute time
    every month, every customer for free
    $0.20 per 1 million requests
    ($0.0000002 per request)
    Never pay for idle

    View full-size slide

  17. 17 09.06.17
    Demo
    DEMO
    https://github.com/kj187/aws_terraform_templates

    View full-size slide

  18. 18 09.06.17
    Alternatives
    Azure Functions
    Microsoft
    Google Cloud Functions
    Google, beta
    OpenWhisk
    IBM

    View full-size slide

  19. 19 09.06.17
    Thank You!

    View full-size slide