Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

The future of paas is serverless

494 views

Published on

Lambda is the next stage in the evolution of the AWS platform. It allows you to build reactive, event-driven systems that are easy to deploy, update and scale. Amazon manages all the undifferentiated heavy-lifting for you so you can focus on delivering value to your customers with even greater speed and cost efficiency.

Join Yan in this talk as we take a deep dive through AWS Lambda and the Serverless framework.

We'll see how to start building reactive systems using AWS Lambda, Kinesis and API Gateway, without having to manage any servers. And, you only pay for your services when they are used. We'll discuss lessons learned, best practices and current limitations with AWS Lambda.

We'll also get to know the Serverless framework, which helps automate both deployment and versioning so that you can better focus on the things that matter to your customers.

Published in: Technology
  • Be the first to comment

The future of paas is serverless

  1. 1. + = THE FUTURE OF PAAS IS SERVERLESS
  2. 2. hi, my name is Yan Cui @theburningmonk
  3. 3. “as a Software Engineer, what is my job?”
  4. 4. “to write code, of course!” - Me, circa 2006
  5. 5. “to provide value to users & stakeholders” - Me, 2016
  6. 6. - Dan North “lead time to someone saying thank you is the only reputation metric that matters.”
  7. 7. THE BALANCE COMPETING FORCES
  8. 8. performance security scalability simplicity cost team time to market
  9. 9. “Programmers know the benefits of everything and the tradeoffs of nothing.” - Rich Hickey https://www.infoq.com/presentations/Simple-Made-Easy
  10. 10. context is the king
  11. 11. security complexity OUTSIDE the code deployment load balancing caching monitoring config management https://www.infoq.com/presentations/complexity-simplicity-esb centralised logging elastic scaling setup server
  12. 12. Leaky Abstraction
  13. 13. AWS re:invent 2014https://www.youtube.com/watch?v=9eHoyUVo-yg
  14. 14. AWS re:invent 2014https://www.youtube.com/watch?v=9eHoyUVo-yg FAAS (Function-As-A-Service)
  15. 15. THERE IS NO SERVER
  16. 16. cost saving
  17. 17. charged by invocations
  18. 18. not paying for idle servers
  19. 19. elastic scaling
  20. 20. hi guys, come back at 10 to find out who won!
  21. 21. everyone came back at exactly 10pm!
  22. 22. everyone came back at exactly 10pm! Lambda scaled instantly
  23. 23. minimise undifferentiated heavy-lifting
  24. 24. “what about containers?”
  25. 25. important, but invisible subsystems
  26. 26. economy of scale
  27. 27. NoOps!!
  28. 28. reactive
  29. 29. simple, fast deployment
  30. 30. first Lambda function went live (team size : 4)
  31. 31. (team size : 7) 155 prod deployments!
  32. 32. - Dan North “lead time to someone saying thank you is the only reputation metric that matters.”
  33. 33. easy to get started
  34. 34. now, we stand at 170 Lambda functions in prod, with 200+ in dev
  35. 35. fuelling the Yubl platform evolution
  36. 36. My Beautiful Monolith
  37. 37. “What would a good architecture for us look like?”
  38. 38. small, incremental deployments fast deployments no downtime no lock-step deployments features deployed independently features loosely-coupled through messages minimise cost for unused resources minimise ops effort
  39. 39. oh, and do all these whilst continue to deliver value, thanks :-) love, your users
  40. 40. completely rebuilt search
  41. 41. Legacy Monolith Amazon Kinesis Amazon Lambda Amazon CloudSearch
  42. 42. Legacy Monolith Amazon Kinesis Amazon Lambda Amazon CloudSearchAmazon API Gateway Amazon Lambda
  43. 43. analytics pipeline
  44. 44. Legacy Monolith Amazon Kinesis Amazon Lambda Google BigQuery
  45. 45. Legacy Monolith Amazon Kinesis Amazon Lambda Google BigQuery 1 developer, 2 days design production (his 1st serverless project)
  46. 46. Legacy Monolith Amazon Kinesis Amazon Lambda Google BigQuery “nothing ever got done this fast at Skype!” - Chris Twamley
  47. 47. - Dan North “lead time to someone saying thank you is the only reputation metric that matters.”
  48. 48. Rebuilt with Lambda
  49. 49. Rebuilt with Lambda
  50. 50. and many more…
  51. 51. “JavaScript doesn’t scale well with complexity” - People on the Internet
  52. 52. but
  53. 53. “limit complexity, and JavaScript isn’t so bad” - Me
  54. 54. USE A
 DEPLOYMENT FRAMEWORK
  55. 55. http://serverless.com
  56. 56. https://github.com/claudiajs/claudia
  57. 57. https://github.com/Miserlou/Zappa
  58. 58. http://gosparta.io/
  59. 59. http://bit.ly/2e7aNDv
  60. 60. TESTING
  61. 61. amzn.to/29Lxuzu
  62. 62. Level of Testing 1.Unit do our objects do the right thing? are they easy to work with?
  63. 63. Level of Testing 1.Unit 2.Integration does our code work against code we can’t change?
  64. 64. handler
  65. 65. handler test by invoking the handler
  66. 66. Level of Testing 1.Unit 2.Integration 3.Acceptance does the whole system work?
  67. 67. Level of Testing unit integration acceptance
  68. 68. Level of Testing unit integration acceptance can do all 3 with Lambda
  69. 69. “…We find that tests that mock external libraries often need to be complex to get the code into the right state for the functionality we need to exercise. The mess in such tests is telling us that the design isn’t right but, instead of fixing the problem by improving the code, we have to carry the extra complexity in both code and test…” Don’t Mock Types You Can’t Change
  70. 70. “…The second risk is that we have to be sure that the behaviour we stub or mock matches what the external library will actually do… Even if we get it right once, we have to make sure that the tests remain valid when we upgrade the libraries…” Don’t Mock Types You Can’t Change
  71. 71. Don’t Mock Types You Can’t Change Services
  72. 72. “…Wherever possible, an acceptance test should exercise the system end-to- end without directly calling its internal code. An end-to-end test interacts with the system only from the outside: through its interface…” Testing End-to-End
  73. 73. Legacy Monolith Amazon Kinesis Amazon Lambda Amazon CloudSearchAmazon API Gateway Amazon Lambda
  74. 74. Legacy Monolith Amazon Kinesis Amazon Lambda Amazon CloudSearchAmazon API Gateway Amazon Lambda Test Input
  75. 75. Legacy Monolith Amazon Kinesis Amazon Lambda Amazon CloudSearchAmazon API Gateway Amazon Lambda Test Input Validate
  76. 76. “…We prefer to have the end-to-end tests exercise both the system and the process by which it’s built and deployed… This sounds like a lot of effort (it is), but has to be done anyway repeatedly during the software’s lifetime…” Testing End-to-End
  77. 77. Jenkins build config deploys and tests unit + integration tests deploy acceptance tests
  78. 78. build.sh allows repeatable builds on both local & CI
  79. 79. LOGGING
  80. 80. 2016-07-12T12:24:37.571Z 994f18f9-482b-11e6-8668-53e4eab441ae GOT is off air, what do I do now?
  81. 81. 2016-07-12T12:24:37.571Z 994f18f9-482b-11e6-8668-53e4eab441ae GOT is off air, what do I do now? UTC Timestamp API Gateway Request Id your log message
  82. 82. organised by Function + Version
  83. 83. LOG OVERLOAD
  84. 84. centralise your logs
  85. 85. CloudWatch Logs AWS Lambda LogStash ElasticSearch
  86. 86. CloudWatch Logs AWS Lambda LogStash ElasticSearch AWS Elasticsearch
  87. 87. CloudWatch Logs AWS Lambda LogStash ElasticSearch AWS Elasticsearch Elastic Cloud
  88. 88. CloudWatch Logs AWS Lambda LogStash ElasticSearch AWS Elasticsearch Elastic Cloud ?
  89. 89. correlation IDs
  90. 90. MONITORING
  91. 91. nowhere to install monitoring agents
  92. 92. no time for background tasks
  93. 93. • Invocation Count • Error Count • Latency (avg, min, max, sum) • Throttling • Granular to the minute • Support custom metrics
  94. 94. • Same basic metrics • Better dashboard • Support custom metrics https://www.datadoghq.com/blog/monitoring-lambda-functions-datadog/
  95. 95. Do It Yourself
  96. 96. PRO TIP set up dashboards
  97. 97. PRO TIP don’t forget to set up alarms
  98. 98. PRO TIP add application-level metrics
  99. 99. KEEP WARM
  100. 100. functions are unloaded if idle for a while
  101. 101. noticeable cold start time (package size matters)
  102. 102. CloudWatch Event AWS Lambda
  103. 103. CloudWatch Event AWS Lambda ping ping ping ping
  104. 104. CloudWatch Event AWS Lambda ping ping ping ping
  105. 105. CloudWatch Event AWS Lambda ping ping ping ping HEALTH CHECKS?
  106. 106. KNOW YOUR LIMITS
  107. 107. max 50 MB deployment package size
  108. 108. max 50 MB deployment package size max 75 GB total deployment package size* * limit is per AWS region
  109. 109. Janitor Monkey
  110. 110. Janitor Lambda
  111. 111. max 5 mins execution time
  112. 112. max 6 MB request payload size* max 6 MB response payload size * for a request-response event type
  113. 113. default max 100 concurrent executions* * soft-limit, can be raised via support ticket
  114. 114. CAPEX OPEX
  115. 115. fail fast fail cheaply
  116. 116. IBM OpenWhisk Amazon Lambda Azure Web Functions Google Cloud Functions competition faster innovation lower prices
  117. 117. @theburningmonk @theburningmonk theburningmonk.com github.com/theburningmonk
  118. 118. @theburningmonk @theburningmonk theburningmonk.com github.com/theburningmonk slides at http://bit.ly/2ecqEql

×