Pro Yearly is on sale from $80 to $50! »

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. Michael Wittig | tecRacer The Life of a Serverless Microservice

    on AWS
  2. Michael Wittig • Author of Amazon Web Services in Action

    (Manning) • AWS Consultant • tecRacer mwittig@tecracer.de @hellomichibye
  3. Life • develop • test • deploy • operate

  4. Serverless Dev Function Event

  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
  6. Serverless Events • File uploaded • E-Mail received • Database

    changed • Manual invoked • HTTP API called • Cron
  7. Microservice Profile Auth Location User GET /profile/michael PUT /loc/michael

  8. None
  9. Code CI & CD Service User Dev Logs Metrics Alerting

  10. Code • AWS CodeCommit – hosted Git Repository – uses

    IAM for access control
  11. Create Repository

  12. None
  13. CI & CD Service User Dev Logs Metrics Alerting

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

    deploy your code – product integrations • Solano Labs – CI as a Service
  15. CI & CD • download sources • install dependencies: npm

    install • run tests: make test • bundle artifact: zip • deploy using CloudFormation – create / update stack
  16. CI & CD • AWS CloudFormation – Infrastructure as Code

    – Pipeline as Code
  17. Create Pipeline

  18. None
  19. None
  20. None
  21. None
  22. Service User Dev Logs Metrics Alerting

  23. Service • Amazon API Gateway – REST API as a

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

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

    call Lambda function 4. map output 5. check output • 100% managed
  26. Service • implement interface • success / failure • limited

    memory • limited execution time • 100% managed
  27. Service • read / write by key • replicated •

    eventual consistent • 99% managed – except scaling
  28. Deploy Service

  29. None
  30. None
  31. None
  32. None
  33. User Dev Logs Metrics Alerting

  34. Logs, Metrics & Alerting • AWS CloudWatch – Metrics –

    Alarms – Logs
  35. Logs, Metrics & Alerting Metric Alarm Filter Dev Source Log

    Group / Stream Source
  36. Setup Monitoring & Alerting

  37. None
  38. None
  39. User Dev

  40. Summary

  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
  42. Code • https://github. com/michaelwittig/devopscon16-auth- service • https://github. com/michaelwittig/devopscon16-profile- service •

    https://github. com/michaelwittig/devopscon16- location-service • https://github.
  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
  44. Use code ctwdevopstw at https://manning.com/wittig Michael Wittig mwittig@tecracer.de @hellomichibye github.com/michaelwittig

    Save 39%