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.

Debunking serverless myths

1,267 views

Published on

In this talk we debunk common myths and misconceptions about serverless - how cold starts works, serverless is not just about saving operational cost, think about control with responsibility, and think about vendor lock-in with the reward.

Published in: Technology

Debunking serverless myths

  1. 1. Debunking Serverless Myths Yan Cui @theburningmonk
  2. 2. Yan Cui http://theburningmonk.com @theburningmonk Principal Engineer @ Independent Consultant
  3. 3. available in Austria, Switzerland, Germany, Japan, Canada, Italy and US on 30+ platforms
  4. 4. ~1,000,000 concurrent viewers
  5. 5. follow @dazneng for updates about the engineering team We’re hiring! Visit engineering.dazn.com to learn more. WE’RE HIRING!
  6. 6. AWS user since 2009
  7. 7. AWS user since 2009
  8. 8. https://productionreadyserverless.com
  9. 9. What do you mean by ‘serverless’?
  10. 10. “Serverless”
  11. 11. Gojko Adzic It is serverless the same way WiFi is wireless. http://bit.ly/2yQgwwb
  12. 12. Serverless means… don’t pay for it if no-one uses it don’t need to worry about scaling don’t need to provision and manage servers
  13. 13. “Function-as-a-Service” AWS Lambda Azure Functions Google Cloud Functions Auth0 Webtask Spotinst Functions Kubeless IBM Cloud Functions
  14. 14. AWS Lambda
  15. 15. AWS Lambda API Gateway IOT SNS Kinesis CloudWatch
  16. 16. IaaS Function Application Runtime Container OS Virtualization Hardware CaaS Function Application Runtime Container OS Virtualization Hardware PaaS Function Application Runtime Container OS Virtualization Hardware FaaS Function Application Runtime Container OS Virtualization Hardware User User (scalable unit) Provider
  17. 17. IaaS Function Application Runtime Container OS Virtualization Hardware CaaS Function Application Runtime Container OS Virtualization Hardware PaaS Function Application Runtime Container OS Virtualization Hardware FaaS Function Application Runtime Container OS Virtualization Hardware User User (scalable unit) Provider
  18. 18. Serverless FaaS other services… Database Storage BI
  19. 19. Simon Wardley Serverless will fundamentally change how we build business around technology and how you code.
  20. 20. Why serverless?
  21. 21. more Scalable (and scales faster!)
  22. 22. Cheaper (don’t pay for idle servers)
  23. 23. Resilience (built-in redundancy and multi-AZ)
  24. 24. Secure
  25. 25. idea production choose language + framework master language + framework figure out deployment configure AMI configure ELB configure autoscaling capacity planning over-provision for launch are we doing microservices? configure CI/CD
  26. 26. idea production choose language + framework master language + framework figure out deployment configure AMI configure ELB configure autoscaling capacity planning over-provision for launch are we doing microservices? configure CI/CD
  27. 27. idea production greater Velocity from idea to product
  28. 28. minimise undifferentiated heavy-lifting
  29. 29. less ops responsibility on your shoulders
  30. 30. What about containers?
  31. 31. important, but invisible subsystem
  32. 32. https://read.acloud.guru/acg-faas-and-furious-b9574b6675c5
  33. 33. serverless is NOT the goal!
  34. 34. build products customers love to use
  35. 35. test ideas against the market quickly
  36. 36. iterate on s
  37. 37. deliver frequently, deliver quickly
  38. 38. own less technology, focus on creating Business Values
  39. 39. own less technology, focus on creating Business Values (serverless is just a good fit for this mindset)
  40. 40. serverless technologies are still maturing
  41. 41. DEBUNKING SERVERLESS MYTHS
  42. 42. DEBUNKING SERVERLESS MYTHS COLD STARTS COLD STARTS overplays or underplays the role of cold starts on serverless performance MYTH #1
  43. 43. DEBUNKING SERVERLESS MYTHS COLD STARTS COLD STARTS overplays or underplays the role of cold starts on serverless performance MYTH #1 COSTSCOSTS misunderstands thereal cost savings fromadopting serverless MYTH #2
  44. 44. DEBUNKING SERVERLESS MYTHS COLD STARTS COLD STARTS overplays or underplays the role of cold starts on serverless performance MYTH #1 COSTSCOSTS misunderstands thereal cost savings fromadopting serverless MYTH #2 CONTROL not realise that control of infra requires expensive skillsets to manage MYTH #3 CONTROL
  45. 45. DEBUNKING SERVERLESS MYTHS COLD STARTS COLD STARTS overplays or underplays the role of cold starts on serverless performance MYTH #1 COSTSCOSTS misunderstands thereal cost savings fromadopting serverless MYTH #2 CONTROL not realise that control of infra requires expensive skillsets to manage MYTH #3 CONTROL LOCK-INnot realise that lock-in risk rewards productivity, and true lock-in is dataMYTH #4 LOCK-IN
  46. 46. COLD STARTSCOLD STARTS overplays or underplays the role of cold starts on serverless performance MYTH #1 LOCK-IN not realise that lock-in risk rewards productivity, and true lock-in is data MYTH #4 LOCK-INCONTROL not realise that control of infra requires expensive skillsets to manage MYTH #3 CONTROLCOSTSCOSTS misunderstands the real cost savings from adopting serverless MYTH #2
  47. 47. INITIALISE CONTAINER INITIALISE RUNTIME INITIALISE HANDLER YOUR CODE EXECUTES
  48. 48. INITIALISE CONTAINER INITIALISE RUNTIME INITIALISE HANDLER YOUR CODE EXECUTES COLD START
  49. 49. “cold starts only happen to the first request”
  50. 50. function invocationconcurrent execution i.e. a container
  51. 51. function invocationconcurrent execution i.e. a container class instance method call
  52. 52. Lambda scales the number of concurrent executions based on traffic
  53. 53. existing “containers” are reused where possible
  54. 54. time invocation
  55. 55. time invocation invocation
  56. 56. time invocation invocation
  57. 57. time invocation invocation invocation invocation
  58. 58. time invocation invocation invocation invocation invocation invocation
  59. 59. time invocation invocation invocation invocation invocation invocation
  60. 60. time invocation invocation invocation invocation invocation invocation invocation
  61. 61. time invocation invocation invocation invocation invocation invocation invocation invocation
  62. 62. time invocation invocation invocation invocation invocation invocation invocation invocation
  63. 63. time invocation invocation invocation invocation invocation invocation invocation invocation
  64. 64. FREQUENCY DURATION
  65. 65. FREQUENCY DURATION dictated by user traffic, out of your control
  66. 66. FREQUENCY DURATION optimize this!
  67. 67. “Lambda is not a suitable solution for me because of cold starts”
  68. 68. “what is your latency requirement?”
  69. 69. cold starts that don’t add to user-facing latency is generally not worth worrying about
  70. 70. Node.js functions, no VPC, 1GB, averages ~500ms cold start with production workload
  71. 71. Node.js functions, no VPC, 1GB, averages ~500ms cold start with production workload (good enough for most web applications)
  72. 72. sporadic spikes latency existed before Lambda
  73. 73. GC pauses…
  74. 74. overloaded servers…
  75. 75. slow downstream, databases, etc.
  76. 76. networking issues…
  77. 77. cold starts is generally not an issue if you have a steady traffic pattern
  78. 78. time req/s
  79. 79. time req/s El Classico
  80. 80. time req/s lunch dinner
  81. 81. minimise the duration of cold starts so they fall within acceptable latency range
  82. 82. use higher memory setting if function performs CPU intensive work
  83. 83. use Node.js, Python or Golang
  84. 84. trim dependencies
  85. 85. keep functions single-purposed
  86. 86. avoid VPCs unless you need to access VPC-protected resources
  87. 87. COSTSCOSTS misunderstands the real cost savings from adopting serverless MYTH #2 LOCK-IN not realise that lock-in risk rewards productivity, and true lock-in is data MYTH #4 LOCK-INCONTROL not realise that control of infra requires expensive skillsets to manage MYTH #3 CONTROL
  88. 88. “good luck when Amazon decides to raise the price of Lambda!”
  89. 89. AWS announced 67 price reductions in the last 5 years, and 0 price hikes
  90. 90. Model Training Low-latency Prediction Serving via Batching
  91. 91. developer but I build CRUD web APIs, why should I care if Lambda is a bad fit for machine learning and serving realtime predictions?
  92. 92. https://aws.amazon.com/solutions/case-studies/financial-engines/
  93. 93. https://www.doc.ic.ac.uk/~rbc/papers/fse-serverless-17.pdf “This paper presents two case industrial studies of early adopters, showing how migrating an application to the Lambda deployment architecture reduced hosting costs – by between 66% and 95%…”
  94. 94. if you wear your shoes on your hands, should you really be surprised your feet is cold? (hint: it’s not because the shoes are not warm!)
  95. 95. recruitment is one of the most important things you can do as an employee it’s also a significant investment
  96. 96. https://bit.ly/2FTXk4q
  97. 97. leverage: do more with less
  98. 98. idea production choose language + framework master language + framework figure out deployment configure AMI configure ELB configure autoscaling capacity planning over-provision for launch are we doing microservices? configure CI/CD
  99. 99. request blue-green deployment req/s auto-scaling us-east-1a us-east-1b us-east-1c multi-AZ
  100. 100. Serverless might cost you just as much, or even more, but you get so much more done
  101. 101. 6 developers, 6 months 95% saving against EC2 15x no. of production releases per month
  102. 102. CONTROL not realise that control of infra requires expensive skillsets to manage MYTH #3 CONTROL LOCK-IN not realise that lock-in risk rewards productivity, and true lock-in is data MYTH #4 LOCK-IN
  103. 103. Control Responsibility
  104. 104. Controlling your own infrastructure comes with Responsibilities
  105. 105. to take on these responsibilities you need to have the relevant skillsets in the organization Controlling your own infrastructure comes with Responsibilities
  106. 106. to take on these responsibilities you need to have the relevant skillsets in the organization Controlling your own infrastructure comes with Responsibilities ENGINEERS
  107. 107. to take on these responsibilities you need to have the relevant skillsets in the organization Controlling your own infrastructure comes with Responsibilities ENGINEERS ADMIN
  108. 108. to take on these responsibilities you need to have the relevant skillsets in the organization Controlling your own infrastructure comes with Responsibilities ENGINEERS ADMIN RECRUITMENT
  109. 109. to take on these responsibilities you need to have the relevant skillsets in the organization Controlling your own infrastructure comes with Responsibilities ENGINEERS ADMIN RECRUITMENT MARKET
  110. 110. what are you paying for?
  111. 111. guard against the temptation to look for control for control sake
  112. 112. AWS Lambda, Azure Functions, Google Cloud Functions Your custom, container-based, general purpose compute platform
  113. 113. LOCK-IN not realise that lock-in risk rewards productivity, and true lock-in is data MYTH #4 LOCK-IN
  114. 114. Lock-in risk Reward
  115. 115. “VENDOR LOCK-IN IS THE ROOT OF ALL EVIL”
  116. 116. use our private cloud instead, it’s totally not a lock-in because containers!
  117. 117. open-source !== freedom
  118. 118. here’s a Ferrari, have at it but I don’t know how to drive! I’ll take a taxi instead…
  119. 119. here’s a Ferrari, have at it but I don’t know how to drive! I’ll take a taxi instead… here’s a million lines of open source code, have at it but I don’t know how to run it! I’ll use a managed service instead…
  120. 120. even open-source solutions require expertise to operate, and expertise are both rare and expensive
  121. 121. to take on these responsibilities you need to have the relevant skills sets in the organization Controlling your own infrastructure comes with Responsibilities ENGINEERS ADMIN RECRUITMENT MARKET
  122. 122. if you already have the expertise, can their time be better used to generate more business value instead?
  123. 123. risk is just one side of the coin
  124. 124. extracting maximum value from your cloud provider minimising undifferentiated heavy-lifting faster time-to-market reward
  125. 125. vendor lock-in is a problem that is all bark but no bite
  126. 126. own less technology, focus on creating Business Values
  127. 127. “DATABASE LOCK-IN IS THE ROOT OF ALL EVIL”
  128. 128. ORM
  129. 129. a load of unnecessary complexity that didn’t end up making DB migrations any easier, and forced you to the least common denominator of feature sets and stop you from taking advantage of your DB in the first place…
  130. 130. nooooooooooo, wish I hadn’t used an ORM!!
  131. 131. The true danger with lock-in, especially with serverless, is the potential for data lock-in. Data has gravity. It accumulates. Data is economically disincentivized to leave, by way of platform pricing. This is the single biggest threat to vendor choice.
  132. 132. is vendor lock-in a risk? YES
  133. 133. is the return worth the risk? ABSOLUTELY!
  134. 134. there are no silver bullets
  135. 135. understand the trade-offs
  136. 136. control comes with its own baggages
  137. 137. but sometimes the benefits outweigh the baggages

×