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.

What can you do with lambda in 2020

In this session, we will look at 10 common use cases for AWS Lambda such as REST APIs, WebSockets, IoT and building event-driven systems. We will also touch on some of the latest platform features such as Provisioned Concurrency, EFS integration and Lambda Destinations and when and where we should use them.

  • Be the first to comment

  • Be the first to like this

What can you do with lambda in 2020

  1. 1. What can you do with Lambda in 2020? Yan Cui, @theburningmonk
  2. 2. What do you mean by ‘serverless’?
  3. 3. “Serverless”
  4. 4. Gojko Adzic It is serverless the same way WiFi is wireless. http://bit.ly/2yQgwwb
  5. 5. 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
  6. 6. in other words, it’s a lot like taking a cab
  7. 7. Ownership Fuel Navigate To get there! Focus on getting there!
  8. 8. HW Ownership OS Runtime & Scale Code Focus on getting there! Physical Servers Virtual Machines Containers Serverless
  9. 9. API Gateway IOT Core SNS SQS S3
  10. 10. auto-scaled by demand
  11. 11. scales to zero don’t pay for idle
  12. 12. us-east-1a us-east-1b us-east-1c multi-AZ by default
  13. 13. us-east-1a us-east-1b us-east-1c built-in load balancing
  14. 14. us-east-1 us-west-1 eu-west-1
  15. 15. us-east-1 us-west-1 eu-west-1 DynamoDB global tables
  16. 16. multi-region active-active us-east-1 us-west-1 eu-west-1
  17. 17. AWS user for 10 years Yan Cui http://theburningmonk.com @theburningmonk
  18. 18. Yan Cui http://theburningmonk.com @theburningmonk bit.ly/yubl-serverless
  19. 19. Developer Advocate @ Yan Cui http://theburningmonk.com @theburningmonk
  20. 20. Yan Cui http://theburningmonk.com @theburningmonk Independent Consultant advisetraining delivery
  21. 21. realworldserverless.com
  22. 22. Learn GraphQL and AppSync by building a Twitter clone with these technologies appsyncmasterclass.com
  23. 23. ? what can YOU DO with in 2020
  24. 24. API Gateway Lambda DynamoDB
  25. 25. API Gateway
  26. 26. API Gateway over 70% cheaper
  27. 27. 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
  28. 28. 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
  29. 29. 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
  30. 30. services that pay by uptime are orders-of-magnitude cheaper when running at scale
  31. 31. “What about cold starts? I need predictable latency!”
  32. 32. first, try to optimize cold start duration so they’re within acceptable latency range
  33. 33. then, consider using Provisioned Concurrency as a fallback
  34. 34. REST APIs
  35. 35. “What about websockets?”
  36. 36. API Gateway AppSync IoT Core
  37. 37. API Gateway AppSync IoT Core
  38. 38. API Gateway Lambda OnConnect
  39. 39. API Gateway Lambda OnConnect DynamoDB
  40. 40. API Gateway Lambda OnConnect DynamoDB Lambda OnDisconnect
  41. 41. API Gateway DynamoDBLambda
  42. 42. API Gateway DynamoDBLambda
  43. 43. low-level construct where YOU have to manage connection mapping
  44. 44. 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…)
  45. 45. API Gateway AppSync IoT Core
  46. 46. scalable, easy to use, but requires GraphQL
  47. 47. API Gateway AppSync IoT Core
  48. 48. requires sig v4 signing (possibly using credentials obtained through Cognito Identity Pool)
  49. 49. messages are always MQTT messages
  50. 50. REST APIs WebSockets
  51. 51. “What if I want to build a GraphQL API instead of REST?”
  52. 52. schema server data sources DynamoDB RDS ElasticSearch AppSync Lambda
  53. 53. AWS AppSync scalable & multi-az out of the box
  54. 54. AWS AppSync scalable & multi-az out of the box pay as you use ($4.00 per Million)
  55. 55. AWS AppSync scalable & multi-az out of the box pay as you use ($4.00 per Million) built-in caching (extra $)
  56. 56. 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
  57. 57. 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
  58. 58. REST APIs WebSockets GraphQL APIs
  59. 59. “Can I implement data pipelines with serverless?”
  60. 60. Kinesis Lambda ?Publisher(s)
  61. 61. realworldserverless.com
  62. 62. Kinesis Lambda ?Publisher(s) Firehose S3 Athena
  63. 63. Kinesis Lambda ?Publisher(s) Firehose S3 Athena Kinesis Analytics Lambda
  64. 64. Kinesis Lambda ?Publisher(s) Firehose S3 Athena Kinesis Analytics Firehose ?
  65. 65. Kinesis Lambda ?Publisher(s) Firehose S3 Athena Kinesis Analytics Kinesis ?
  66. 66. REST APIs WebSockets GraphQL APIs Big Data
  67. 67. CloudTrail EventBridge Lambda
  68. 68. Config EventBridge Lambda
  69. 69. REST APIs WebSockets GraphQL APIs Big Data DevOps/DevSecOps
  70. 70. “How do I model complex business workflows?”
  71. 71. Step Functions
  72. 72. orchestration service that allows you to model workflows as state machines
  73. 73. design with JSON https://states-language.net/spec.html
  74. 74. $25 PER MILLION
  75. 75. $25 PER MILLION 15X LAMBDA PRICING!
  76. 76. bit.ly/complete-guide-to-aws-step-functions
  77. 77. REST APIs WebSockets GraphQL APIs Big Data DevOps/DevSecOps Business Workflows
  78. 78. “Can I encode videos with Lambda?”
  79. 79. S3 Lambda ?
  80. 80. S3 Lambda Elemental MediaConvert
  81. 81. S3 Lambda Elemental MediaConvert
  82. 82. an X min video file is likely going to take X mins to encode
  83. 83. S3 Lambda Step Functions
  84. 84. split
  85. 85. Map split
  86. 86. split Map …
  87. 87. split Map …
  88. 88. split Map … { … } { … } { … } { … } { … }
  89. 89. split Map … { … } { … } { … } { … } { … } [{ … }, { … } … ]
  90. 90. Map split stitch
  91. 91. Map split stitch
  92. 92. Transcode video segments in parallel. Reduced processing time from ~20 mins to ~2 mins.
  93. 93. REST APIs WebSockets GraphQL APIs Big Data DevOps/DevSecOps Video Encoding Business Workflows
  94. 94. “Event-driven architectures are all the rage, how does it look like?”
  95. 95. “What do I use as the event bus?”
  96. 96. EventBridge SNS prefer over
  97. 97. EventBridge SNS
  98. 98. EventBridge schema discovery & schema registry
  99. 99. content-based filtering enables a centralized event bus EventBridge
  100. 100. EventBridge AWS Services 3rd Partners Your Application
  101. 101. EventBridge AWS Services 3rd Partners Your Application Lambda Lambda Lambda
  102. 102. EventBridge AWS Services 3rd Partners Your Application Lambda Lambda Lambda
  103. 103. “How do I handle failures?”
  104. 104. DLQ
  105. 105. SNS, SQS, Lambda, EventBridge
  106. 106. FAILURE DESTINATION
  107. 107. FAILURE DESTINATION
  108. 108. FAILURE DESTINATION
  109. 109. FAILURE DESTINATION
  110. 110. MORE targets Stream invocations too!
  111. 111. prefer Lambda Destinations to DLQs (both can be used side-by-side)
  112. 112. what about OnSuccess?
  113. 113. OnSuccess
  114. 114. REST APIs WebSockets GraphQL APIs Big Data DevOps/DevSecOps Event-Driven Architecture Video Encoding Business Workflows
  115. 115. LambdaAlexa Skills
  116. 116. REST APIs WebSockets GraphQL APIs Big Data DevOps/DevSecOps Event-Driven Architecture Video Encoding Business Workflows Alexa skills
  117. 117. IOT Core Lambda
  118. 118. REST APIs WebSockets GraphQL APIs Big Data DevOps/DevSecOps Alexa skills IOT Event-Driven Architecture Video Encoding Business Workflows
  119. 119. REST APIs WebSockets GraphQL APIs Big Data DevOps/DevSecOps Alexa skills IOT Event-Driven Architecture Video Encoding Business Workflows
  120. 120. “When is serverless not the right choice?”
  121. 121. What are your non-functional requirements?
  122. 122. Can Lambda meet your performance and scaling requirements?
  123. 123. What’s the Total Cost of Ownership (TCO) for serverless?
  124. 124. https://go.aws/2XThRxK
  125. 125. https://go.aws/2XThRxK
  126. 126. But, sometimes, the infrastructure far outweighs staffing cost
  127. 127. 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
  128. 128. Learn GraphQL and AppSync by building a Twitter clone with these technologies appsyncmasterclass.com
  129. 129. Thank You

    Be the first to comment

In this session, we will look at 10 common use cases for AWS Lambda such as REST APIs, WebSockets, IoT and building event-driven systems. We will also touch on some of the latest platform features such as Provisioned Concurrency, EFS integration and Lambda Destinations and when and where we should use them.

Views

Total views

913

On Slideshare

0

From embeds

0

Number of embeds

75

Actions

Downloads

11

Shares

0

Comments

0

Likes

0

×