The Life of a Serverless Microservice on AWS

The Life of a Serverless Microservice on AWS

In this 60 minute session we will develop, test, deploy and operate a production ready microservice using the AWS ecosystem. The combination of AWS Lambda and Amazon API Gateway allows us to operate a REST endpoint without the need of any virtual machines. We will use Amazon DynamoDB as our database, Amazon CloudWatch for metrics and logs, and AWS CodeCommit and AWS CodePipeline as our delivery pipeline. Production ready includes:
* automated testing
* API authentication
* logs (collection and alerts)
* monitoring (metrics and alerts)
* continuous build and deploy pipeline
This will be a hands-on session with live coding and sharing of practical experience. I promise: there will be no servers!

Conference: https://devopsconference.de/session/the-life-of-a-serverless-microservice-on-aws/

E8f66870d1204779ecc45f2695faa73e?s=128

Michael Wittig

June 14, 2016
Tweet

Transcript

  1. 2.

    Michael Wittig • Author of Amazon Web Services in Action

    (Manning) • AWS Consultant • tecRacer mwittig@tecracer.de @hellomichibye
  2. 5.

    Serverless • only pay when function is executed – $0,0000002

    + $0,000000208 / 100 ms – $1 := 2,5 mio invocations • 100% managed – no under/over provisioning – no boot time, no patching, no SSH – no load balancing
  3. 6.

    Serverless Events • File uploaded • E-Mail received • Database

    changed • Manual invoked • HTTP API called • Cron
  4. 8.
  5. 12.
  6. 14.

    CI & CD • AWS CodePipeline – build, test, and

    deploy your code – product integrations • Solano Labs – CI as a Service
  7. 15.

    CI & CD • download sources • install dependencies: npm

    install • run tests: make test • bundle artifact: zip • deploy using CloudFormation – create / update stack
  8. 18.
  9. 19.
  10. 20.
  11. 21.
  12. 23.

    Service • Amazon API Gateway – REST API as a

    Service • AWS Lambda – code execution – event triggered • Amazon DynamoDB – Key-Value- / Document-Store
  13. 25.

    Service 1. check input 2. map input to JSON 3.

    call Lambda function 4. map output 5. check output • 100% managed
  14. 26.

    Service • implement interface • success / failure • limited

    memory • limited execution time • 100% managed
  15. 27.

    Service • read / write by key • replicated •

    eventual consistent • 99% managed – except scaling
  16. 29.
  17. 30.
  18. 31.
  19. 32.
  20. 37.
  21. 38.
  22. 39.
  23. 40.
  24. 41.

    Logs & Monitoring CI & CD Test Git Deploy Profile

    Auth Locatio n Bundle JSON JS git push GET /profile/michael HTTP/1.1 PUT /loc/michael HTTP/1.1 Services Log s Metr ics Alertin g Alertin g Dev User Code • Service dependencies • Authentitcation
  25. 43.

    Pittfals • CodePipeline / CodeCommit only available in us-east-1 at

    the moment • Soft limits – Concurrent Lambda invocations (100) – API Gateway RPS (1000) • CloudFormation, CodePipeline and Solano Labs has limitations