Advertisement

What can you do with lambda in 2020

Yan Cui
Speaker at Self
Jun. 13, 2020
Advertisement

More Related Content

Advertisement

What can you do with lambda in 2020

  1. ? what can YOU DO with in 2020 Yan Cui @theburningmonk
  2. What do you mean by ‘serverless’?
  3. @theburningmonk theburningmonk.com “Serverless”
  4. @theburningmonk theburningmonk.com
  5. @theburningmonk theburningmonk.com Gojko Adzic It is serverless the same way WiFi is wireless. http://bit.ly/2yQgwwb
  6. @theburningmonk theburningmonk.com 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
  7. @theburningmonk theburningmonk.com in other words, it’s a lot like taking a cab
  8. @theburningmonk theburningmonk.com Ownership Fuel Navigate To get there! Focus on getting there!
  9. @theburningmonk theburningmonk.com HW Ownership OS Runtime & Scale Code Physical Servers
  10. @theburningmonk theburningmonk.com HW Ownership OS Runtime & Scale Code Physical Servers Virtual Machines
  11. @theburningmonk theburningmonk.com HW Ownership OS Runtime & Scale Code Physical Servers Virtual Machines Containers
  12. @theburningmonk theburningmonk.com HW Ownership OS Runtime & Scale Code Focus on getting there! Physical Servers Virtual Machines Containers Serverless
  13. @theburningmonk theburningmonk.com HW Ownership OS Runtime & Scale Code Focus on getting there! Physical Servers Virtual Machines Containers Serverless
  14. @theburningmonk theburningmonk.com Serviceful Self Managed Metered Usage
  15. @theburningmonk theburningmonk.com
  16. @theburningmonk theburningmonk.com API Gateway IOT Core SNS SQS S3
  17. @theburningmonk theburningmonk.com auto-scaled by demand
  18. @theburningmonk theburningmonk.com scales to zero
  19. @theburningmonk theburningmonk.com scales to zero don’t pay for idle
  20. @theburningmonk theburningmonk.com us-east-1a us-east-1b us-east-1c multi-AZ by default
  21. @theburningmonk theburningmonk.com us-east-1a us-east-1b us-east-1c
  22. @theburningmonk theburningmonk.com us-east-1a us-east-1b us-east-1c built-in load balancing
  23. @theburningmonk theburningmonk.com us-east-1a us-east-1b us-east-1c
  24. @theburningmonk theburningmonk.com us-east-1a us-east-1b us-east-1c DynamoDB global tables
  25. @theburningmonk theburningmonk.com us-east-1a us-east-1b us-east-1c multi-region active-active
  26. Why serverless?
  27. @theburningmonk theburningmonk.com more Scalable (and scales faster!)
  28. @theburningmonk theburningmonk.com Cheaper (don’t pay for idle servers)
  29. @theburningmonk theburningmonk.com Resilience (built-in redundancy and multi-AZ)
  30. @theburningmonk theburningmonk.com Secure
  31. @theburningmonk theburningmonk.com 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
  32. @theburningmonk theburningmonk.com 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
  33. @theburningmonk theburningmonk.com idea production greater Velocity from idea to product
  34. @theburningmonk theburningmonk.com youtube.com/watch?v=evsz__BDprs It used to take me longer to configure infrastructure for my application!
  35. @theburningmonk theburningmonk.com minimise undifferentiated heavy-lifting
  36. @theburningmonk theburningmonk.com less ops responsibility on your shoulders
  37. Yan Cui http://theburningmonk.com @theburningmonk AWS user for 10 years
  38. http://bit.ly/yubl-serverless
  39. Yan Cui http://theburningmonk.com @theburningmonk Developer Advocate @
  40. Yan Cui http://theburningmonk.com @theburningmonk Independent Consultant advisetraining delivery
  41. theburningmonk.com/courses
  42. theburningmonk.com/courses
  43. realworldserverless.com
  44. ? what can YOU DO with in 2020
  45. @theburningmonk theburningmonk.com API Gateway Lambda DynamoDB
  46. @theburningmonk theburningmonk.com API Gateway
  47. @theburningmonk theburningmonk.com API Gateway over 70% cheaper
  48. @theburningmonk theburningmonk.com https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html
  49. @theburningmonk theburningmonk.com ALB 1 LCU gives you 25 new connections per second 3000 active connections per minute 0.4 GB per hour for Lambda function targets 1000 rule evaluations per second * averaged over an hour
  50. @theburningmonk theburningmonk.com 1 TPS, 200ms avg latency, 1KB data processing / req API Gateway ALB $2.5921 x 60s x 60m x 24hr x 30days @ $1.00 per hour 24hr x 30days @ $0.0225 per hour + 1 x 24hr x 30days @ $0.008 per hour $21.96 $9.0721 x 60s x 60m x 24hr x 30days @ $3.50 per hour REST HTTP
  51. @theburningmonk theburningmonk.com 1,000 TPS, 200ms avg latency, 1KB data processing / req 25 new connections per second 3000 active connections per minute 0.4 GB per hour for Lambda function targets 1000 rule evaluations per second = 1000 / 25 = 40 LCU = 1000 x 60s / 3000 = 20 LCU = 1kb x 1000 x 60s x 60m / 0.4 GB = 8.58 LCU = 1000 / 1000 = 1 LCU
  52. @theburningmonk theburningmonk.com 1,000 TPS, 200ms avg latency, 1KB data processing / req API Gateway ALB $25921000 x 60s x 60m x 24hr x 30days @ $1.00 per hour 24hr x 30days @ $0.0225 per hour + 40 x 24hr x 30days @ $0.008 per hour $246.6 $90721000 x 60s x 60m x 24hr x 30days @ $3.50 per hour REST HTTP
  53. @theburningmonk theburningmonk.com services that pay by uptime are orders-of-magnitude cheaper when running at scale
  54. @theburningmonk theburningmonk.com ALB canary deploy with stickiness routing based on HTTP headers or query string params
  55. @theburningmonk theburningmonk.com “What about cold starts? I need predictable latency!”
  56. @theburningmonk theburningmonk.com first, try to optimize cold start duration so they’re within acceptable latency range
  57. @theburningmonk theburningmonk.com then, consider using Provisioned Concurrency as a fallback
  58. @theburningmonk theburningmonk.com REST APIs
  59. @theburningmonk theburningmonk.com “What about websockets?”
  60. @theburningmonk theburningmonk.com API Gateway AppSync IoT Core
  61. @theburningmonk theburningmonk.com API Gateway AppSync IoT Core
  62. @theburningmonk theburningmonk.com
  63. @theburningmonk theburningmonk.com API Gateway Lambda OnConnect
  64. @theburningmonk theburningmonk.com API Gateway Lambda OnConnect DynamoDB
  65. @theburningmonk theburningmonk.com API Gateway Lambda OnConnect DynamoDB Lambda OnDisconnect
  66. @theburningmonk theburningmonk.com API Gateway DynamoDBLambda
  67. @theburningmonk theburningmonk.com API Gateway DynamoDBLambda
  68. @theburningmonk theburningmonk.com low-level construct where YOU have to manage connection mapping
  69. @theburningmonk theburningmonk.com no support for broadcasts (e.g. broadcasting to a million connected users equates to fetching 1M items from DynamoDB and then make 1M API calls to API Gateway…)
  70. @theburningmonk theburningmonk.com API Gateway AppSync IoT Core
  71. @theburningmonk theburningmonk.com
  72. @theburningmonk theburningmonk.com
  73. @theburningmonk theburningmonk.com
  74. @theburningmonk theburningmonk.com scalable, easy to use, but requires GraphQL
  75. @theburningmonk theburningmonk.com API Gateway AppSync IoT Core
  76. @theburningmonk theburningmonk.com
  77. @theburningmonk theburningmonk.com requires sig v4 signing (possibly using credentials obtained through Cognito Identity Pool)
  78. @theburningmonk theburningmonk.com messages are always MQTT messages
  79. @theburningmonk theburningmonk.com REST APIs WebSockets
  80. @theburningmonk theburningmonk.com “What if I want to build a GraphQL API instead of REST?”
  81. @theburningmonk theburningmonk.com schema server data sources DynamoDB RDS ElasticSearch AppSync Lambda
  82. @theburningmonk theburningmonk.com AWS AppSync scalable & multi-az out of the box
  83. @theburningmonk theburningmonk.com AWS AppSync scalable & multi-az out of the box pay as you use ($4.00 per Million)
  84. @theburningmonk theburningmonk.com AWS AppSync scalable & multi-az out of the box pay as you use ($4.00 per Million) built-in caching (extra $)
  85. @theburningmonk theburningmonk.com AWS AppSync scalable & multi-az out of the box pay as you use ($4.00 per Million) built-in caching (extra $) built-in metrics through CloudWatch built-in logging through CloudWatch Logs
  86. @theburningmonk theburningmonk.com AWS AppSync scalable & multi-az out of the box pay as you use ($4.00 per Million) built-in caching (extra $) built-in metrics through CloudWatch built-in logging through CloudWatch Logs no servers to manage
  87. @theburningmonk theburningmonk.com REST APIs WebSockets GraphQL APIs
  88. @theburningmonk theburningmonk.com “Can I implement data pipelines with serverless?”
  89. @theburningmonk theburningmonk.com Kinesis Lambda ?Publisher(s)
  90. @theburningmonk theburningmonk.com realworldserverless.com
  91. @theburningmonk theburningmonk.com Kinesis Lambda ?Publisher(s) Firehose S3 Athena
  92. @theburningmonk theburningmonk.com Kinesis Lambda ?Publisher(s) Firehose S3 Athena Kinesis Analytics Lambda
  93. @theburningmonk theburningmonk.com Kinesis Lambda ?Publisher(s) Firehose S3 Athena Kinesis Analytics Firehose ?
  94. @theburningmonk theburningmonk.com Kinesis Lambda ?Publisher(s) Firehose S3 Athena Kinesis Analytics Kinesis ?
  95. @theburningmonk theburningmonk.com REST APIs WebSockets GraphQL APIs Big Data
  96. @theburningmonk theburningmonk.com
  97. @theburningmonk theburningmonk.com
  98. @theburningmonk theburningmonk.com
  99. @theburningmonk theburningmonk.com
  100. @theburningmonk theburningmonk.com
  101. @theburningmonk theburningmonk.com CloudTrail EventBridge Lambda
  102. @theburningmonk theburningmonk.com
  103. @theburningmonk theburningmonk.com
  104. @theburningmonk theburningmonk.com
  105. @theburningmonk theburningmonk.com Config EventBridge Lambda
  106. @theburningmonk theburningmonk.com REST APIs WebSockets GraphQL APIs Big Data DevOps/DevSecOps
  107. @theburningmonk theburningmonk.com “How do I model complex business workflows?”
  108. @theburningmonk theburningmonk.com Step Functions
  109. @theburningmonk theburningmonk.com orchestration service that allows you to model workflows as state machines
  110. @theburningmonk theburningmonk.com design with JSON https://states-language.net/spec.html
  111. @theburningmonk theburningmonk.com
  112. @theburningmonk theburningmonk.com Step Functions OOP class instanceexecution input arguments
  113. @theburningmonk theburningmonk.com start a state machine via.. StepFunctions .startExecution(req) .promise()
  114. @theburningmonk theburningmonk.com start a state machine via.. API Gateway StepFunctions .startExecution(req) .promise()
  115. @theburningmonk theburningmonk.com start a state machine via.. EventBridge including cron StepFunctions .startExecution(req) .promise() API Gateway
  116. @theburningmonk theburningmonk.com
  117. @theburningmonk theburningmonk.com
  118. @theburningmonk theburningmonk.com
  119. @theburningmonk theburningmonk.com
  120. @theburningmonk theburningmonk.com
  121. @theburningmonk theburningmonk.com state transitions
  122. @theburningmonk theburningmonk.com
  123. @theburningmonk theburningmonk.com $25 PER MILLION
  124. @theburningmonk theburningmonk.com $25 PER MILLION 15X LAMBDA PRICING!
  125. @theburningmonk theburningmonk.com https://aws.amazon.com/about-aws/whats-new/2019/12/introducing-aws-step-functions-express-workflows
  126. @theburningmonk theburningmonk.com
  127. @theburningmonk theburningmonk.com bit.ly/complete-guide-to-aws-step-functions
  128. @theburningmonk theburningmonk.com REST APIs WebSockets GraphQL APIs Big Data DevOps/DevSecOps Business Workflows
  129. @theburningmonk theburningmonk.com “Can I encode videos with Lambda?”
  130. @theburningmonk theburningmonk.com S3 Lambda ?
  131. @theburningmonk theburningmonk.com S3 Lambda Elemental MediaConvert
  132. @theburningmonk theburningmonk.com S3 Lambda Elemental MediaConvert
  133. @theburningmonk theburningmonk.com an X min video file is likely going to take X mins to encode
  134. @theburningmonk theburningmonk.com S3 Lambda Step Functions
  135. @theburningmonk theburningmonk.com split
  136. @theburningmonk theburningmonk.com Map split
  137. @theburningmonk theburningmonk.com split Map …
  138. @theburningmonk theburningmonk.com split Map …
  139. @theburningmonk theburningmonk.com split Map … { … } { … } { … } { … } { … }
  140. @theburningmonk theburningmonk.com split Map … { … } { … } { … } { … } { … } [{ … }, { … } … ]
  141. @theburningmonk theburningmonk.com Map split stitch
  142. @theburningmonk theburningmonk.com Map split stitch
  143. @theburningmonk theburningmonk.com Transcode video segments in parallel. Reduced processing time from ~20 mins to ~2 mins.
  144. @theburningmonk theburningmonk.com REST APIs WebSockets GraphQL APIs Big Data DevOps/DevSecOps Video Encoding Business Workflows
  145. @theburningmonk theburningmonk.com “Event-driven architectures are all the rage, how does it look like?”
  146. @theburningmonk theburningmonk.com “What do I use as the event bus?”
  147. @theburningmonk theburningmonk.com EventBridge SNS prefer over
  148. @theburningmonk theburningmonk.com EventBridge SNS
  149. @theburningmonk theburningmonk.com EventBridge schema discovery & schema registry
  150. @theburningmonk theburningmonk.com EventBridge content-based filtering enables a centralized event bus
  151. @theburningmonk theburningmonk.com EventBridge AWS Services 3rd Partners Your Application
  152. @theburningmonk theburningmonk.com EventBridge AWS Services 3rd Partners Your Application Lambda Lambda Lambda
  153. @theburningmonk theburningmonk.com EventBridge AWS Services 3rd Partners Your Application Lambda Lambda Lambda
  154. @theburningmonk theburningmonk.com “How do I handle failures?”
  155. @theburningmonk theburningmonk.com DLQ
  156. @theburningmonk theburningmonk.com SNS, SQS, Lambda, EventBridge
  157. @theburningmonk theburningmonk.com FAILURE DESTINATION
  158. @theburningmonk theburningmonk.com FAILURE DESTINATION
  159. @theburningmonk theburningmonk.com FAILURE DESTINATION
  160. @theburningmonk theburningmonk.com FAILURE DESTINATION
  161. @theburningmonk theburningmonk.com
  162. @theburningmonk theburningmonk.com MORE targets Stream invocations too!
  163. @theburningmonk theburningmonk.com prefer Lambda Destinations to DLQs (both can be used side-by-side)
  164. @theburningmonk theburningmonk.com what about OnSuccess?
  165. @theburningmonk theburningmonk.com OnSuccess
  166. @theburningmonk theburningmonk.com
  167. @theburningmonk theburningmonk.com REST APIs WebSockets GraphQL APIs Big Data DevOps/DevSecOps Event-Driven Architecture Video Encoding Business Workflows
  168. @theburningmonk theburningmonk.com
  169. @theburningmonk theburningmonk.com LambdaAlexa Skills
  170. @theburningmonk theburningmonk.com REST APIs WebSockets GraphQL APIs Big Data DevOps/DevSecOps Event-Driven Architecture Video Encoding Business Workflows Alexa skills
  171. @theburningmonk theburningmonk.com
  172. @theburningmonk theburningmonk.com IOT Core Lambda
  173. @theburningmonk theburningmonk.com REST APIs WebSockets GraphQL APIs Big Data DevOps/DevSecOps Alexa skills IOT Event-Driven Architecture Video Encoding Business Workflows
  174. @theburningmonk theburningmonk.com REST APIs WebSockets GraphQL APIs Big Data DevOps/DevSecOps Alexa skills IOT Event-Driven Architecture Video Encoding Business Workflows
  175. @theburningmonk theburningmonk.com “When is serverless not the right choice?”
  176. @theburningmonk theburningmonk.com What are your non-functional requirements?
  177. @theburningmonk theburningmonk.com Can Lambda meet your performance and scaling requirements?
  178. @theburningmonk theburningmonk.com What’s the Total Cost of Ownership (TCO) for serverless?
  179. @theburningmonk theburningmonk.com
  180. @theburningmonk theburningmonk.com https://go.aws/2XThRxK
  181. @theburningmonk theburningmonk.com https://go.aws/2XThRxK
  182. @theburningmonk theburningmonk.com But, sometimes, the infrastructure far outweighs staffing cost
  183. @theburningmonk theburningmonk.com
  184. @theburningmonk theburningmonk.com
  185. @theburningmonk theburningmonk.com lambdabestpractice.com
  186. https://theburningmonk.com/hire-me AdviseTraining Delivery “Fundamentally, Yan has improved our team by increasing our ability to derive value from AWS and Lambda in particular.” Nick Blair Tech Lead
  187. @theburningmonk theburningmonk.com github.com/theburningmonk
Advertisement