Advertisement
Advertisement

More Related Content

Slideshows for you(19)

Advertisement

Similar to The future of paas is serverless(20)

Advertisement

The future of paas is serverless

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