<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Slides | Coding Cloud</title>
    <link>https://rawsanj.dev/slides/</link>
      <atom:link href="https://rawsanj.dev/slides/index.xml" rel="self" type="application/rss+xml" />
    <description>Slides</description>
    <generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><copyright>© 2024. Sanjay Rawat</copyright><lastBuildDate>Tue, 11 Jun 2024 00:00:00 +0000</lastBuildDate>
    <item>
      <title>Blazing Fast SQS Listener</title>
      <link>https://rawsanj.dev/slides/blazing-fast-sqs-listener/</link>
      <pubDate>Tue, 11 Jun 2024 00:00:00 +0000</pubDate>
      <guid>https://rawsanj.dev/slides/blazing-fast-sqs-listener/</guid>
      <description>
&lt;section data-noprocess data-shortcode-slide
  
      
      data-background-image=&#34;./SQS_EKS_ECS.svg&#34;
  
      
      data-background-repeat=&#34;none&#34;
  
      
      data-background-size=&#34;1500px&#34;
  &gt;

&lt;h1 style=&#34;color: #114a5b !important;&#34; id=&#34;bz&#34;&gt;Blazing Fast&lt;/h1&gt;
&lt;h2 style=&#34;color: #114a5b !important;&#34; id=&#34;cf&#34;&gt;Cost Effective&lt;/h2&gt;
&lt;h2 style=&#34;color: #114a5b !important;&#34; id=&#34;res&#34;&gt;&amp; Resilient&lt;/h2&gt;
&lt;h1 style=&#34;color: #114a5b !important;&#34; id=&#34;lis&#34;&gt;AWS SQS Listener&lt;/h1&gt;
&lt;hr&gt;
&lt;p&gt;Hi there, I&amp;rsquo;m Sanjay 👋!&lt;/p&gt;
&lt;a href=&#34;https://www.linkedin.com/in/rawsanj&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;LinkedIn Badge&#34; src=&#34;https://img.shields.io/badge/-/in/rawsanj-0A66C2?style=for-the-badge&amp;logo=Linkedin&amp;logoColor=white&amp;link=https://www.linkedin.com/in/rawsanj&#34; /&gt;
&lt;/a&gt;
&lt;a href=&#34;https://rawsanj.dev&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;Website Badge&#34; src=&#34;https://img.shields.io/badge/-rawsanj.dev-4CAF50?style=for-the-badge&amp;logo=curl&amp;logoColor=white&amp;link=https://rawsanj.dev&#34; /&gt;
&lt;/a&gt;
&lt;a href=&#34;https://twitter.com/Raw_Sanj&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;Twitter Badge&#34; src=&#34;https://img.shields.io/static/v1?label=&amp;message=@Raw_Sanj&amp;color=E8EAEC&amp;style=for-the-badge&amp;logo=X&amp;logoColor=000000&amp;link=https://twitter.com/Raw_Sanj&#34;/&gt;
&lt;/a&gt;
&lt;a href=&#34;https://github.com/RawSanj&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;Github Badge&#34; src=&#34;https://img.shields.io/badge/-/RawSanj-181717?style=for-the-badge&amp;logo=Github&amp;logoColor=white&amp;link=https://github.com/RawSanj&#34; /&gt;
&lt;/a&gt;
&lt;a href=&#34;https://stackoverflow.com/users/5702727/sanjay-rawat?tab=profile&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;Stack Overflow&#34; src=&#34;https://img.shields.io/badge/Stack%20Overflow-F58025?style=for-the-badge&amp;logo=Stack%20Overflow&amp;logoColor=bcbbbb&amp;link=https://stackoverflow.com/users/5702727/sanjay-rawat?tab=profile&#34; /&gt;
&lt;/a&gt;
&lt;h3 id=&#34;about-me&#34;&gt;About me&lt;/h3&gt;
&lt;ul style=&#34;font-size: 22px&#34;&gt;
  &lt;li&gt;🔭 &lt;strong&gt;Working:&lt;/strong&gt; Lead Software Engineer - working on Spring Boot, Reactive Programming, Microservices, Kafka, Cassandra, Kubernetes, AWS.&lt;/li&gt;
  &lt;li&gt;🖥️ &lt;strong&gt;Interests:&lt;/strong&gt; I love building cool Software &amp; Systems, Self-Hosting, Gaming&lt;/li&gt;
  &lt;li&gt;🌱 &lt;strong&gt;Learning:&lt;/strong&gt; &lt;del&gt;Go&lt;/del&gt; | Rust | Scala | Design Patterns &lt;/li&gt;
  &lt;li&gt;💬 &lt;strong&gt;Ask me about:&lt;/strong&gt; Java | Reactive Spring | Containers | AWS &lt;/li&gt;
  &lt;li&gt;🧑‍🤝‍🧑 &lt;strong&gt;Collaboration:&lt;/strong&gt; Looking to collaborate on several projects over here, check out my GitHub&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;
&lt;h4 id=&#34;languages-frameworks-and-platforms&#34;&gt;Languages, Frameworks and Platforms&lt;/h4&gt;
&lt;img alt=&#34;Java&#34; src=&#34;https://img.shields.io/badge/Java-f0931c?style=for-the-badge&amp;logo=openjdk&amp;logoColor=507e9c&#34; /&gt;
&lt;img alt=&#34;Spring&#34; src=&#34;https://img.shields.io/badge/Spring-6DB33F?style=for-the-badge&amp;logo=spring&amp;logoColor=white&#34; /&gt;
&lt;img alt=&#34;Kotlin&#34; src=&#34;https://img.shields.io/badge/Kotlin-4d7ddd?&amp;style=for-the-badge&amp;logo=kotlin&amp;logoColor=&#34; /&gt;
&lt;img alt=&#34;Project Reactor&#34; src=&#34;https://img.shields.io/badge/Project_Reactor-6db33f?style=for-the-badge&amp;logo=React&amp;logoColor=white&#34; /&gt;
&lt;img alt=&#34;Kafka&#34; src=&#34;https://img.shields.io/badge/-Kafka-727272?style=for-the-badge&amp;logo=apachekafka&amp;logoColor&#34; /&gt;
&lt;img alt=&#34;Cassandra&#34; src=&#34;https://img.shields.io/badge/Cassandra-1287B1?style=for-the-badge&amp;logo=apache%20cassandra&amp;logoColor=d4effc&#34; /&gt;
&lt;img alt=&#34;AWS&#34; src=&#34;https://img.shields.io/badge/AWS-242e3c?style=for-the-badge&amp;logo=Amazon&amp;logoColor=f79400&#34; /&gt;
&lt;img alt=&#34;Kubernetes&#34; src=&#34;https://img.shields.io/badge/kubernetes-%23326ce5.svg?style=for-the-badge&amp;logo=kubernetes&amp;logoColor=white&#34; /&gt;
&lt;hr&gt;
&lt;h3 id=&#34;what-is-aws-sqs&#34;&gt;What is AWS SQS&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;SQS offers a Secure, Durable, and Highly Available Hosted Queue&lt;/li&gt;
&lt;li&gt;Used to integrate and decouple distributed software systems and components&lt;/li&gt;
&lt;li&gt;Standard queues support &lt;a href=&#34;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html#standard-queues-at-least-once-delivery&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;at-least-once&lt;/a&gt; message delivery, and FIFO queues support &lt;a href=&#34;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;exactly-once&lt;/a&gt; message processing and &lt;a href=&#34;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;high-throughput&lt;/a&gt; mode&lt;/li&gt;
&lt;li&gt;Offers &lt;a href=&#34;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Dead Letter Queues&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&#34;sqs-concepts-wrt-lambda&#34;&gt;SQS Concepts w.r.t Lambda&lt;/h3&gt;
&lt;ul style=&#34;font-size: 28px&#34;&gt;
  &lt;li&gt;&lt;u&gt;Queue Types&lt;/u&gt;: Standard and FIFO&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Visibility timeout&lt;/u&gt;: wait time after which message is visible again if not deleted after processing&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;In-Flight messages&lt;/u&gt;: messages that are received by the consumer but not deleted&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;SQS Event Source Mapping&lt;/u&gt;: Lambda Service reads items from a SQS &amp;amp; invokes Lambda Function&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Enable trigger&lt;/u&gt;: Enable or disable SQS-Lambda Integration&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Batch size&lt;/u&gt;: number of records to send to the function in each batch. Standard: 10,000(max). FIFO: 10(max)&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Batch window&lt;/u&gt;: wait time (in second) to gather records before invoking the function, applicable for Standard Queue&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Reserved Concurrency&lt;/u&gt;: the maximum number of concurrent instances allocated to your function.&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Maximum Concurrency&lt;/u&gt;: the number of concurrent instances of the function that an Amazon SQS event source can invoke.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&#34;message-lifecycle&#34;&gt;Message Lifecycle&lt;/h3&gt;
&lt;img src=&#34;https://docs.aws.amazon.com/images/AWSSimpleQueueService/latest/SQSDeveloperGuide/images/sqs-message-lifecycle-diagram.png&#34; alt=&#34;sqs-message-lifecycle&#34; height=&#34;70%&#34;/&gt;
&lt;hr&gt;
&lt;h3 id=&#34;sqs-visibility-timeout&#34;&gt;SQS Visibility Timeout&lt;/h3&gt;
&lt;img src=&#34;https://docs.aws.amazon.com/images/AWSSimpleQueueService/latest/SQSDeveloperGuide/images/sqs-visibility-timeout-diagram.png&#34; alt=&#34;SQS Visibility Timeout&#34; height=&#34;50%&#34; width=&#34;50%&#34;/&gt;
&lt;ul style=&#34;font-size: 25px&#34;&gt;
  &lt;li&gt;To avoid message loss, it&#39;s consumers responsibility to delete the message after processing&lt;/li&gt;
  &lt;li&gt;Message remains in queue after it is received, but SQS sets a visibility timeout to prevent other consumer from processing same message again&lt;/li&gt;
  &lt;li&gt;Default visibility timeout is 30 seconds. Can be set between 0 seconds to 12 hours&lt;/li&gt;
  &lt;li&gt;Can be set a Queue level or dynamically changed per message&lt;/li&gt;
  &lt;li&gt;&lt;b&gt;Caution&lt;/b&gt;: When using FIFO make sure to use Message GroupId which provides high distribution to avoid blocking processing due to error&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&#34;font-size: 20px&#34;&gt;
  &lt;strong style=&#34;font-size: 20px&#34;&gt;Note: &lt;/strong&gt;
  &lt;li&gt;For Standard queues, the visibility timeout isn&#39;t a guarantee against receiving a message twice. &lt;/li&gt;
  &lt;li&gt;FIFO queues allow the producer or consumer to attempt multiple retries: producers can retry send using deduplicationId and consumers doesn&#39;t receive messages for same message groupId unless deleted or timed-out&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&#34;sqs-lambda-integration-architecture&#34;&gt;SQS Lambda Integration Architecture&lt;/h3&gt;
&lt;img src=&#34;./SQS_Lambda_Architecture.svg&#34; alt=&#34;SQS_Lambda_Architecture&#34;/&gt;
&lt;ol style=&#34;font-size: 22px&#34;&gt;
  &lt;li&gt;FIVE Instances Lambda Service polls SQS queue every &lt;a href=&#34;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html#SQS-ReceiveMessage-request-WaitTimeSeconds&#34; target=&#34;_blank&#34;&gt;WaitTimeSeconds&lt;/a&gt; secs &lt;br&gt;(defaults to 20s). More info  &lt;a href=&#34;https://stackoverflow.com/a/52905561&#34; target=&#34;_blank&#34;&gt;here.&lt;/a&gt;&lt;b&gt;*&lt;/b&gt;&lt;/li&gt;
  &lt;li&gt;Function code is invoked when &lt;a href=&#34;https://docs.aws.amazon.com/lambda/latest/api/API_CreateEventSourceMapping.html#lambda-CreateEventSourceMapping-request-BatchSize&#34; target=&#34;_blank&#34;&gt;BatchSize&lt;/a&gt; number of messages are accumulated or &lt;a href=&#34;https://docs.aws.amazon.com/lambda/latest/api/API_CreateEventSourceMapping.html#lambda-CreateEventSourceMapping-request-MaximumBatchingWindowInSeconds&#34;&gt;MaximumBatchingWindowInSeconds&lt;/a&gt; are passed after receiving first message. &lt;br&gt;&lt;small&gt; Function invocation is scaled if more messages are available in queue.&lt;/small&gt;&lt;/li&gt;
  &lt;li&gt;Function responds with List of failed messages (if &lt;a href=&#34;https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-batchfailurereporting&#34; target=&#34;_blank&#34;&gt;ReportBatchItemFailures&lt;/a&gt; is enabled) or Success/Error.&lt;/li&gt;
  &lt;li&gt;Lambda Service deletes the successfully processed messages.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style=&#34;font-size: 22px&#34;&gt; 
&lt;b&gt;Note: *&lt;/b&gt;There is no clear documentation from AWS regarding SQS polling frequency.
&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&#34;lambda-scaling&#34;&gt;Lambda Scaling&lt;/h3&gt;
&lt;ul style=&#34;font-size: 25px&#34;&gt;
  &lt;li&gt;&lt;b&gt;Standard Queues&lt;/b&gt;: Lambda uses &lt;a href=&#34;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html&#34; target=&#34;_blank&#34;&gt;long polling&lt;/a&gt; &amp; reads up to 5 batches to invoke your function.&lt;/li&gt;
  &lt;li&gt;Up until &lt;b&gt;06 Nov 2023&lt;/b&gt;, the Lambda was adding up to &lt;b&gt;60 concurrent executions/minute&lt;/b&gt;, scaling up to a maximum of &lt;b&gt;1,250&lt;/b&gt; concurrent executions in approximately &lt;b&gt;20 minutes&lt;/b&gt;.&lt;/li&gt;
  &lt;li&gt;Now Lambda functions can scale up to 5x faster, adding up to &lt;b&gt;300 concurrent executions/minute&lt;/b&gt;.&lt;/li&gt;
  &lt;li&gt;Even at peak performance, the Maximum number of messages processed concurrently by Lambda &lt;b&gt;=&lt;/b&gt; 10 to 10K messages in a batch &lt;b&gt;x&lt;/b&gt; 1250 executions &lt;b&gt;=&lt;/b&gt; &lt;b&gt;12.5K to 12.5M&lt;/b&gt;&lt;/li&gt;
  &lt;li&gt;&lt;b&gt;FIFO queues&lt;/b&gt;: Lambda sends messages to your function in the order that it receives them and ensures that messages in the same group are delivered to Lambda in order.&lt;/li&gt;
  &lt;li&gt;Lambda sorts the messages into groups and sends only one batch at a time for a group.&lt;/li&gt;
  &lt;li&gt;Your function can scale in concurrency to the number of active message groups.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;faster-polling-scale-up-for-aws-lambdahttpsawsamazoncomblogscomputeintroducing-faster-polling-scale-up-for-aws-lambda-functions-configured-with-amazon-sqs&#34;&gt;&lt;a href=&#34;https://aws.amazon.com/blogs/compute/introducing-faster-polling-scale-up-for-aws-lambda-functions-configured-with-amazon-sqs/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Faster polling scale-up for AWS Lambda&lt;/a&gt;&lt;/h4&gt;
&lt;hr&gt;
&lt;h3 id=&#34;how-can-we-do-this-ourselves-but-better&#34;&gt;How can we do this ourselves? But Better!&lt;/h3&gt;
&lt;ol style=&#34;font-size: 30px&#34;&gt;
  &lt;li&gt;Implement a Dynamic SQS Poller, based on Number of Messages.&lt;/li&gt;
  &lt;li&gt;Convert Message to POJO &amp; Concurrently Invoke Processing Logic.&lt;/li&gt;
  &lt;li&gt;For FIFO Queues, make sure to process messages from same GroupId in Sequence, while processing the Groups Concurrently.&lt;/li&gt;
  &lt;li&gt;Categorize Exceptions into Retryable &amp; Non-Retryable.&lt;/li&gt;
  &lt;li&gt;Implement Error Handling, Retries and Timeout.&lt;/li&gt;
  &lt;li&gt;Publish the Failed Messages Directly to the DLQ and Mark it as Processed.&lt;/li&gt;
  &lt;li&gt;Collect the Processed messages &amp; Delete those in Batch.&lt;/li&gt;
  &lt;li&gt;Implement Listener Health-check - when Listener stops polling/processing, set the health to DOWN.&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;

&lt;section data-noprocess data-shortcode-slide
  
      
      data-background-image=&#34;https://quotefancy.com/media/wallpaper/3840x2160/1700728-Linus-Torvalds-Quote-Talk-is-cheap-Show-me-the-code.jpg&#34;
  
      
      data-background-repeat=&#34;none&#34;
  &gt;

&lt;h1 style=&#34;display: none&#34;&gt;Code&lt;/h1&gt;
&lt;hr&gt;
&lt;h1 id=&#34;questions&#34;&gt;Questions?&lt;/h1&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src=&#34;slides_qr.png&#34; alt=&#34;slide qr code&#34;&gt;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&lt;img src=&#34;rawsanj_qr.png&#34; alt=&#34;profile qr code&#34; style=&#34;min-width:105%&#34;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</description>
    </item>
    
    <item>
      <title>AWS SQS &#43; Lambda Integration</title>
      <link>https://rawsanj.dev/slides/aws-sqs-lambda-integration/</link>
      <pubDate>Thu, 20 Apr 2023 00:00:00 +0000</pubDate>
      <guid>https://rawsanj.dev/slides/aws-sqs-lambda-integration/</guid>
      <description>
&lt;section data-noprocess data-shortcode-slide
  
      
      data-background-image=&#34;./SQS_Lambda.svg&#34;
  
      
      data-background-repeat=&#34;none&#34;
  
      
      data-background-size=&#34;1500px&#34;
  &gt;

&lt;h1 style=&#34;color: #114a5b !important;&#34; id=&#34;aws-sqs&#34;&gt;AWS SQS&lt;/h1&gt;
&lt;h1 style=&#34;color: #114a5b !important;&#34; id=&#34;lambda-integration&#34;&gt;Lambda Integration&lt;/h1&gt;
&lt;h2 style=&#34;color: #114a5b !important;&#34; id=&#34;with-resiliency-patterns&#34;&gt;with Resiliency Patterns&lt;/h2&gt;
&lt;h3 id=&#34;documentationhttpsdocsawsamazoncomawssimplequeueservicelatestsqsdeveloperguidewelcomehtml&#34;&gt;&lt;a href=&#34;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Documentation&lt;/a&gt;&lt;/h3&gt;
&lt;hr&gt;
&lt;p&gt;Hi there, I&amp;rsquo;m Sanjay 👋!&lt;/p&gt;
&lt;a href=&#34;https://www.linkedin.com/in/rawsanj&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;LinkedIn Badge&#34; src=&#34;https://img.shields.io/badge/-/in/rawsanj-0A66C2?style=for-the-badge&amp;logo=Linkedin&amp;logoColor=white&amp;link=https://www.linkedin.com/in/rawsanj&#34; /&gt;
&lt;/a&gt;
&lt;a href=&#34;https://rawsanj.dev&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;Website Badge&#34; src=&#34;https://img.shields.io/badge/-rawsanj.dev-4CAF50?style=for-the-badge&amp;logo=curl&amp;logoColor=white&amp;link=https://rawsanj.dev&#34; /&gt;
&lt;/a&gt;
&lt;a href=&#34;https://twitter.com/Raw_Sanj&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;Twitter Badge&#34; src=&#34;https://img.shields.io/static/v1?label=&amp;message=@Raw_Sanj&amp;color=E8EAEC&amp;style=for-the-badge&amp;logo=X&amp;logoColor=000000&amp;link=https://twitter.com/Raw_Sanj&#34;/&gt;
&lt;/a&gt;
&lt;a href=&#34;https://github.com/RawSanj&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;Github Badge&#34; src=&#34;https://img.shields.io/badge/-/RawSanj-181717?style=for-the-badge&amp;logo=Github&amp;logoColor=white&amp;link=https://github.com/RawSanj&#34; /&gt;
&lt;/a&gt;
&lt;a href=&#34;https://stackoverflow.com/users/5702727/sanjay-rawat?tab=profile&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;Stack Overflow&#34; src=&#34;https://img.shields.io/badge/Stack%20Overflow-F58025?style=for-the-badge&amp;logo=Stack%20Overflow&amp;logoColor=bcbbbb&amp;link=https://stackoverflow.com/users/5702727/sanjay-rawat?tab=profile&#34; /&gt;
&lt;/a&gt;
&lt;h3 id=&#34;about-me&#34;&gt;About me&lt;/h3&gt;
&lt;ul style=&#34;font-size: 22px&#34;&gt;
  &lt;li&gt;🔭 &lt;strong&gt;Working:&lt;/strong&gt; Lead Software Engineer - working on Spring Boot, Reactive Programming, Microservices, Kafka, Cassandra, Kubernetes, AWS.&lt;/li&gt;
  &lt;li&gt;🖥️ &lt;strong&gt;Interests:&lt;/strong&gt; I love building cool Software &amp; Systems, Self-Hosting, Gaming&lt;/li&gt;
  &lt;li&gt;🌱 &lt;strong&gt;Learning:&lt;/strong&gt; &lt;del&gt;Go&lt;/del&gt; | Rust | Scala | Design Patterns &lt;/li&gt;
  &lt;li&gt;💬 &lt;strong&gt;Ask me about:&lt;/strong&gt; Java | Reactive Spring | Containers | AWS &lt;/li&gt;
  &lt;li&gt;🧑‍🤝‍🧑 &lt;strong&gt;Collaboration:&lt;/strong&gt; Looking to collaborate on several projects over here, check out my GitHub&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;
&lt;h4 id=&#34;languages-frameworks-and-platforms&#34;&gt;Languages, Frameworks and Platforms&lt;/h4&gt;
&lt;img alt=&#34;Java&#34; src=&#34;https://img.shields.io/badge/Java-f0931c?style=for-the-badge&amp;logo=openjdk&amp;logoColor=507e9c&#34; /&gt;
&lt;img alt=&#34;Spring&#34; src=&#34;https://img.shields.io/badge/Spring-6DB33F?style=for-the-badge&amp;logo=spring&amp;logoColor=white&#34; /&gt;
&lt;img alt=&#34;Kotlin&#34; src=&#34;https://img.shields.io/badge/Kotlin-4d7ddd?&amp;style=for-the-badge&amp;logo=kotlin&amp;logoColor=&#34; /&gt;
&lt;img alt=&#34;Project Reactor&#34; src=&#34;https://img.shields.io/badge/Project_Reactor-6db33f?style=for-the-badge&amp;logo=React&amp;logoColor=white&#34; /&gt;
&lt;img alt=&#34;Kafka&#34; src=&#34;https://img.shields.io/badge/-Kafka-727272?style=for-the-badge&amp;logo=apachekafka&amp;logoColor&#34; /&gt;
&lt;img alt=&#34;Cassandra&#34; src=&#34;https://img.shields.io/badge/Cassandra-1287B1?style=for-the-badge&amp;logo=apache%20cassandra&amp;logoColor=d4effc&#34; /&gt;
&lt;img alt=&#34;AWS&#34; src=&#34;https://img.shields.io/badge/AWS-242e3c?style=for-the-badge&amp;logo=Amazon&amp;logoColor=f79400&#34; /&gt;
&lt;img alt=&#34;Kubernetes&#34; src=&#34;https://img.shields.io/badge/kubernetes-%23326ce5.svg?style=for-the-badge&amp;logo=kubernetes&amp;logoColor=white&#34; /&gt;
&lt;hr&gt;
&lt;h3 id=&#34;what-is-aws-sqs&#34;&gt;What is AWS SQS&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;SQS offers a Secure, Durable, and Highly Available Hosted Queue&lt;/li&gt;
&lt;li&gt;Used to integrate and decouple distributed software systems and components&lt;/li&gt;
&lt;li&gt;Standard queues support &lt;a href=&#34;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html#standard-queues-at-least-once-delivery&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;at-least-once&lt;/a&gt; message delivery, and FIFO queues support &lt;a href=&#34;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;exactly-once&lt;/a&gt; message processing and &lt;a href=&#34;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;high-throughput&lt;/a&gt; mode&lt;/li&gt;
&lt;li&gt;Offers &lt;a href=&#34;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Dead Letter Queues&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&#34;sqs-concepts-wrt-lambda&#34;&gt;SQS Concepts w.r.t Lambda&lt;/h3&gt;
&lt;ul style=&#34;font-size: 30px&#34;&gt;
  &lt;li&gt;&lt;u&gt;Queue Types&lt;/u&gt;: Standard and FIFO&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Visibility timeout&lt;/u&gt;: wait time after which message is visible again if not deleted after processing&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Message retention period&lt;/u&gt;: 1 minute to 14 days (defaults to 4 days)&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Delivery delay&lt;/u&gt;: 0 seconds to 15 minutes&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;SQS Event Source Mapping&lt;/u&gt;: Lambda Service reads items from a SQS &amp;amp; invokes Lambda Function&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Enable trigger&lt;/u&gt;: Enable or disable SQS-Lambda Integration&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Batch size&lt;/u&gt;: number of records to send to the function in each batch. Standard: 10,000(max). FIFO: 10(max)&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Batch window&lt;/u&gt;: wait time (in second) to gather records before invoking the function, applicable for Standard&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&#34;message-lifecycle&#34;&gt;Message Lifecycle&lt;/h3&gt;
&lt;img src=&#34;https://docs.aws.amazon.com/images/AWSSimpleQueueService/latest/SQSDeveloperGuide/images/sqs-message-lifecycle-diagram.png&#34; alt=&#34;sqs-message-lifecycle&#34; height=&#34;70%&#34;/&gt;
&lt;hr&gt;
&lt;h3 id=&#34;sqs-visibility-timeout&#34;&gt;SQS Visibility Timeout&lt;/h3&gt;
&lt;img src=&#34;https://docs.aws.amazon.com/images/AWSSimpleQueueService/latest/SQSDeveloperGuide/images/sqs-visibility-timeout-diagram.png&#34; alt=&#34;SQS Visibility Timeout&#34; height=&#34;50%&#34; width=&#34;50%&#34;/&gt;
&lt;ul style=&#34;font-size: 25px&#34;&gt;
  &lt;li&gt;To avoid message loss, it&#39;s consumers responsibility to delete the message after processing&lt;/li&gt;
  &lt;li&gt;Message remains in queue after it is received, but SQS sets a visibility timeout to prevent other consumer from processing same message again&lt;/li&gt;
  &lt;li&gt;Default visibility timeout is 30 seconds. Can be set between 0 seconds to 12 hours&lt;/li&gt;
  &lt;li&gt;Can be set a Queue level or dynamically changed per message&lt;/li&gt;
  &lt;li&gt;&lt;b&gt;Caution&lt;/b&gt;: When using FIFO make sure to use Message GroupId which provides high distribution to avoid blocking processing due to error&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&#34;font-size: 20px&#34;&gt;
  &lt;strong style=&#34;font-size: 20px&#34;&gt;Note: &lt;/strong&gt;
  &lt;li&gt;For Standard queues, the visibility timeout isn&#39;t a guarantee against receiving a message twice. &lt;/li&gt;
  &lt;li&gt;FIFO queues allow the producer or consumer to attempt multiple retries: producers can retry send using deduplicationId and consumers doesn&#39;t receive messages for same message groupId unless deleted or timed-out&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&#34;in-flight-messages--scaling&#34;&gt;In-Flight Messages &amp;amp; Scaling&lt;/h3&gt;
&lt;ul style=&#34;font-size: 25px&#34;&gt;
  &lt;li&gt;Messages that are received by the consumer but not deleted are known as In-Flight messages&lt;/li&gt;
  &lt;li&gt;For Standard queues: there can be a maximum of approximately 120,000 in flight messages&lt;/li&gt;
  &lt;li&gt;For FIFO queues: there can be a maximum of 20,000 in flight messages&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&#34;border-top: 3px solid #476672; padding: 4px&#34;&gt;&lt;/div&gt;
&lt;ul style=&#34;font-size: 25px&#34;&gt;
  &lt;li&gt;&lt;b&gt;Standard Queues&lt;/b&gt;: Lambda uses &lt;a href=&#34;https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html&#34; target=&#34;_blank&#34;&gt;long polling&lt;/a&gt; &amp; reads up to 5 batches to invoke your function.&lt;/li&gt;
  &lt;li&gt;Up until &lt;b&gt;06 Nov 2023&lt;/b&gt;, the Lambda was adding up to &lt;b&gt;60 concurrent executions/minute&lt;/b&gt;, scaling up to a maximum of &lt;b&gt;1,250&lt;/b&gt; concurrent executions in approximately &lt;b&gt;20 minutes&lt;/b&gt;.&lt;/li&gt;
  &lt;li&gt;Now Lambda functions can scale up to 5x faster, adding up to &lt;b&gt;300 concurrent executions/minute&lt;/b&gt;.&lt;/li&gt;
  &lt;li&gt;Even at peak performance, the Maximum number of messages processed concurrently by Lambda = 10 messages in a batch * 1250 executions = &lt;b&gt;12,500&lt;/b&gt;&lt;/li&gt;
  &lt;li&gt;&lt;b&gt;FIFO queues&lt;/b&gt;: Lambda sends messages to your function in the order that it receives them and ensures that messages in the same group are delivered to Lambda in order.&lt;/li&gt;
  &lt;li&gt;Lambda sorts the messages into groups and sends only one batch at a time for a group.&lt;/li&gt;
  &lt;li&gt;Your function can scale in concurrency to the number of active message groups.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&#34;sqs-message-event-in-lambda-function---standard&#34;&gt;SQS Message Event in Lambda Function - Standard&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;quot;Records&amp;quot;: [
    {
      &amp;quot;messageId&amp;quot;: &amp;quot;059f36b4-87a3-44ab-83d2-661975830a7d&amp;quot;,
      &amp;quot;receiptHandle&amp;quot;: &amp;quot;AQEBwJnKyrHigUMZj6rYigCgxlaS3SLy0a...&amp;quot;,
      &amp;quot;body&amp;quot;: &amp;quot;Test message.&amp;quot;,
      &amp;quot;attributes&amp;quot;: {
        &amp;quot;ApproximateReceiveCount&amp;quot;: &amp;quot;1&amp;quot;,
        &amp;quot;SentTimestamp&amp;quot;: &amp;quot;1545082649183&amp;quot;,
        &amp;quot;SenderId&amp;quot;: &amp;quot;AIDAIENQZJOLO23YVJ4VO&amp;quot;,
        &amp;quot;ApproximateFirstReceiveTimestamp&amp;quot;: &amp;quot;1545082649185&amp;quot;
      },
      &amp;quot;messageAttributes&amp;quot;: {},
      &amp;quot;md5OfBody&amp;quot;: &amp;quot;e4e68fb7bd0e697a0ae8f1bb342846b3&amp;quot;,
      &amp;quot;eventSource&amp;quot;: &amp;quot;aws:sqs&amp;quot;,
      &amp;quot;eventSourceARN&amp;quot;: &amp;quot;arn:aws:sqs:us-east-2:123456789012:my-queue&amp;quot;,
      &amp;quot;awsRegion&amp;quot;: &amp;quot;us-east-2&amp;quot;
    },
    ...
  ]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3 id=&#34;sqs-message-event-in-lambda-function---fifo&#34;&gt;SQS Message Event in Lambda Function - FIFO&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;quot;Records&amp;quot;: [
    {
      &amp;quot;messageId&amp;quot;: &amp;quot;11d6ee51-4cc7-4302-9e22-7cd8afdaadf5&amp;quot;,
      &amp;quot;receiptHandle&amp;quot;: &amp;quot;AQEBBX8nesZEXmkhsmZeyIE8iQAMig7qw...&amp;quot;,
      &amp;quot;body&amp;quot;: &amp;quot;Test message.&amp;quot;,
      &amp;quot;attributes&amp;quot;: {
        &amp;quot;ApproximateReceiveCount&amp;quot;: &amp;quot;1&amp;quot;,
        &amp;quot;SentTimestamp&amp;quot;: &amp;quot;1573251510774&amp;quot;,
        &amp;quot;SequenceNumber&amp;quot;: &amp;quot;18849496460467696128&amp;quot;,
        &amp;quot;MessageGroupId&amp;quot;: &amp;quot;1&amp;quot;,
        &amp;quot;SenderId&amp;quot;: &amp;quot;AIDAIO23YVJENQZJOL4VO&amp;quot;,
        &amp;quot;MessageDeduplicationId&amp;quot;: &amp;quot;1&amp;quot;,
        &amp;quot;ApproximateFirstReceiveTimestamp&amp;quot;: &amp;quot;1573251510774&amp;quot;
      },
      &amp;quot;messageAttributes&amp;quot;: {},
      &amp;quot;md5OfBody&amp;quot;: &amp;quot;e4e68fb7bd0e697a0ae8f1bb342846b3&amp;quot;,
      &amp;quot;eventSource&amp;quot;: &amp;quot;aws:sqs&amp;quot;,
      &amp;quot;eventSourceARN&amp;quot;: &amp;quot;arn:aws:sqs:us-east-2:123456789012:fifo.fifo&amp;quot;,
      &amp;quot;awsRegion&amp;quot;: &amp;quot;us-east-2&amp;quot;
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3 id=&#34;sqs-resiliency-pattern-with-lambda&#34;&gt;SQS Resiliency Pattern with Lambda&lt;/h3&gt;
&lt;div style=&#34;font-size: 25px&#34;&gt;Enable Batch Error Reporting by running: &lt;/div&gt;
&lt;pre&gt;&lt;code class=&#34;language-shell&#34;&gt;aws lambda update-event-source-mapping \
    --uuid &amp;quot;a1b2c3d4-5678-90ab-cdef-123401&amp;quot; \
    --function-response-types &amp;quot;ReportBatchItemFailures&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&#34;font-size: 25px&#34;&gt;Update your Lambda Function code to collect messageId of failed messages: &lt;/div&gt;
&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;quot;batchItemFailures&amp;quot;: [
    {
      &amp;quot;itemIdentifier&amp;quot;: &amp;quot;message-id-1&amp;quot;
    },
    {
      &amp;quot;itemIdentifier&amp;quot;: &amp;quot;message-id-4&amp;quot;
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href=&#34;https://medium.com/srcecde/handle-sqs-message-failure-in-batch-with-partial-batch-response-b858ad212573&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Blog Post on Batch Error Reporting&lt;/a&gt; by &lt;a href=&#34;https://github.com/srcecde&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;srcecde&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;

&lt;section data-noprocess data-shortcode-slide
  
      
      data-background-image=&#34;https://quotefancy.com/media/wallpaper/3840x2160/1700728-Linus-Torvalds-Quote-Talk-is-cheap-Show-me-the-code.jpg&#34;
  
      
      data-background-repeat=&#34;none&#34;
  &gt;

&lt;h1 style=&#34;display: none&#34;&gt;Code&lt;/h1&gt;
&lt;hr&gt;
&lt;h1 id=&#34;questions&#34;&gt;Questions?&lt;/h1&gt;
</description>
    </item>
    
    <item>
      <title>AWS Lambda Deep Dive</title>
      <link>https://rawsanj.dev/slides/aws-lambda/</link>
      <pubDate>Sun, 26 Mar 2023 00:00:00 +0000</pubDate>
      <guid>https://rawsanj.dev/slides/aws-lambda/</guid>
      <description>
&lt;section data-noprocess data-shortcode-slide
  
      
      data-background-image=&#34;https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Amazon_Lambda_architecture_logo.svg/1024px-Amazon_Lambda_architecture_logo.svg.png&#34;
  
      
      data-background-repeat=&#34;repeat&#34;
  
      
      data-background-size=&#34;1024px&#34;
  &gt;

&lt;h1 id=&#34;aws-lambda&#34;&gt;AWS Lambda&lt;/h1&gt;
&lt;h1 id=&#34;deep-dive&#34;&gt;Deep Dive&lt;/h1&gt;
&lt;h3 id=&#34;documentationhttpsdocsawsamazoncomlambdalatestdgwelcomehtml&#34;&gt;&lt;a href=&#34;https://docs.aws.amazon.com/lambda/latest/dg/welcome.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Documentation&lt;/a&gt;&lt;/h3&gt;
&lt;hr&gt;
&lt;p&gt;Hi there, I&amp;rsquo;m Sanjay 👋!&lt;/p&gt;
&lt;a href=&#34;https://www.linkedin.com/in/rawsanj&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;LinkedIn Badge&#34; src=&#34;https://img.shields.io/badge/-/in/rawsanj-0A66C2?style=for-the-badge&amp;logo=Linkedin&amp;logoColor=white&amp;link=https://www.linkedin.com/in/rawsanj&#34; /&gt;
&lt;/a&gt;
&lt;a href=&#34;https://rawsanj.dev&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;Website Badge&#34; src=&#34;https://img.shields.io/badge/-rawsanj.dev-4CAF50?style=for-the-badge&amp;logo=curl&amp;logoColor=white&amp;link=https://rawsanj.dev&#34; /&gt;
&lt;/a&gt;
&lt;a href=&#34;https://twitter.com/Raw_Sanj&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;Twitter Badge&#34; src=&#34;https://img.shields.io/static/v1?label=&amp;message=@Raw_Sanj&amp;color=E8EAEC&amp;style=for-the-badge&amp;logo=X&amp;logoColor=000000&amp;link=https://twitter.com/Raw_Sanj&#34;/&gt;
&lt;/a&gt;
&lt;a href=&#34;https://github.com/RawSanj&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;Github Badge&#34; src=&#34;https://img.shields.io/badge/-/RawSanj-181717?style=for-the-badge&amp;logo=Github&amp;logoColor=white&amp;link=https://github.com/RawSanj&#34; /&gt;
&lt;/a&gt;
&lt;a href=&#34;https://stackoverflow.com/users/5702727/sanjay-rawat?tab=profile&#34; target=&#34;_blank&#34;&gt;
&lt;img alt=&#34;Stack Overflow&#34; src=&#34;https://img.shields.io/badge/Stack%20Overflow-F58025?style=for-the-badge&amp;logo=Stack%20Overflow&amp;logoColor=bcbbbb&amp;link=https://stackoverflow.com/users/5702727/sanjay-rawat?tab=profile&#34; /&gt;
&lt;/a&gt;
&lt;h3 id=&#34;about-me&#34;&gt;About me&lt;/h3&gt;
&lt;ul style=&#34;font-size: 22px&#34;&gt;
  &lt;li&gt;🔭 &lt;strong&gt;Working:&lt;/strong&gt; Lead Software Engineer - working on Spring Boot, Reactive Programming, Microservices, Kafka, Cassandra, Kubernetes, AWS.&lt;/li&gt;
  &lt;li&gt;🖥️ &lt;strong&gt;Interests:&lt;/strong&gt; I love building cool Software &amp; Systems, Self-Hosting, Gaming&lt;/li&gt;
  &lt;li&gt;🌱 &lt;strong&gt;Learning:&lt;/strong&gt; &lt;del&gt;Go&lt;/del&gt; | Rust | Scala | Design Patterns &lt;/li&gt;
  &lt;li&gt;💬 &lt;strong&gt;Ask me about:&lt;/strong&gt; Java | Reactive Spring | Containers | AWS &lt;/li&gt;
  &lt;li&gt;🧑‍🤝‍🧑 &lt;strong&gt;Collaboration:&lt;/strong&gt; Looking to collaborate on several projects over here, check out my GitHub&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;
&lt;h4 id=&#34;languages-frameworks-and-platforms&#34;&gt;Languages, Frameworks and Platforms&lt;/h4&gt;
&lt;img alt=&#34;Java&#34; src=&#34;https://img.shields.io/badge/Java-f0931c?style=for-the-badge&amp;logo=openjdk&amp;logoColor=507e9c&#34; /&gt;
&lt;img alt=&#34;Spring&#34; src=&#34;https://img.shields.io/badge/Spring-6DB33F?style=for-the-badge&amp;logo=spring&amp;logoColor=white&#34; /&gt;
&lt;img alt=&#34;Kotlin&#34; src=&#34;https://img.shields.io/badge/Kotlin-4d7ddd?&amp;style=for-the-badge&amp;logo=kotlin&amp;logoColor=&#34; /&gt;
&lt;img alt=&#34;Project Reactor&#34; src=&#34;https://img.shields.io/badge/Project_Reactor-6db33f?style=for-the-badge&amp;logo=React&amp;logoColor=white&#34; /&gt;
&lt;img alt=&#34;Kafka&#34; src=&#34;https://img.shields.io/badge/-Kafka-727272?style=for-the-badge&amp;logo=apachekafka&amp;logoColor&#34; /&gt;
&lt;img alt=&#34;Cassandra&#34; src=&#34;https://img.shields.io/badge/Cassandra-1287B1?style=for-the-badge&amp;logo=apache%20cassandra&amp;logoColor=d4effc&#34; /&gt;
&lt;img alt=&#34;AWS&#34; src=&#34;https://img.shields.io/badge/AWS-242e3c?style=for-the-badge&amp;logo=Amazon&amp;logoColor=f79400&#34; /&gt;
&lt;img alt=&#34;Kubernetes&#34; src=&#34;https://img.shields.io/badge/kubernetes-%23326ce5.svg?style=for-the-badge&amp;logo=kubernetes&amp;logoColor=white&#34; /&gt;
&lt;hr&gt;
&lt;h3 id=&#34;what-is-aws-lambda-function&#34;&gt;What is AWS Lambda Function&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;A Compute Service to run code without Provisioning or Managing Servers&lt;/li&gt;
&lt;li&gt;Uses Containerization tech called &lt;a href=&#34;https://firecracker-microvm.github.io&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Firecracker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Handles Server &amp;amp; OS Maintenance, Provisioning, Auto-Scaling, Logging&lt;/li&gt;
&lt;li&gt;Code in one of the Languages supported by &lt;a href=&#34;https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Lambda Runtimes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&#34;lambda-concepts&#34;&gt;Lambda Concepts&lt;/h3&gt;
&lt;ul style=&#34;font-size: 35px&#34;&gt;
  &lt;li&gt;&lt;u&gt;Function&lt;/u&gt;: a resource invoked to run your code&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Trigger&lt;/u&gt;: a resource/config that invokes a Lambda Function&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Event&lt;/u&gt;: a JSON-formatted data for a Lambda Function to Process&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Event Source Mapping&lt;/u&gt;: a resource that reads items from a Stream/Queue &amp;amp; invokes a function&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Execution Env&lt;/u&gt;: provides a secure and isolated Runtime Environment for your Lambda function&lt;/li&gt;
  &lt;li&gt;&lt;u&gt;Runtime&lt;/u&gt;: provides a lang-specific Environment that runs in an Execution Environment&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&#34;what-is-lambda-runtimes&#34;&gt;What is Lambda Runtimes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Runtime provides a lang-specific env that runs in an execution env&lt;/li&gt;
&lt;li&gt;It relays invocation Events, Context, &amp;amp; Responses between Lambda &amp;amp; the Function&lt;/li&gt;
&lt;li&gt;Use AWS provided Lambda Runtimes or Build your own by implementing &lt;a href=&#34;https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Runtime API&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&#34;execution-environment--runtime&#34;&gt;Execution Environment &amp;amp; Runtime&lt;/h3&gt;
&lt;img src=&#34;https://docs.aws.amazon.com/images/lambda/latest/dg/images/telemetry-api-concept-diagram.png&#34; alt=&#34;Lambda Execution Environment&#34; width=&#34;80%&#34;/&gt;
&lt;img src=&#34;https://docs.aws.amazon.com/images/lambda/latest/dg/images/Overview-Invoke-with-Error.png&#34; alt=&#34;Lambda Execution Environment&#34; width=&#34;120%&#34;/&gt;
&lt;hr&gt;
&lt;h3 id=&#34;supported-lambda-runtimes&#34;&gt;Supported Lambda Runtimes&lt;/h3&gt;
&lt;table style=&#34;font-size: 30px&#34;&gt;
  &lt;thead&gt;
    &lt;tr&gt;
    &lt;th style=&#34;text-align:right&#34;&gt;&lt;/th&gt;
    &lt;th style=&#34;text-align:left&#34;&gt;&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
    &lt;td style=&#34;text-align:right&#34;&gt;Node.js&lt;/td&gt;
    &lt;td style=&#34;text-align:left&#34;&gt;v18, v16, v14 &amp;amp; v12*&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td style=&#34;text-align:right&#34;&gt;Python&lt;/td&gt;
    &lt;td style=&#34;text-align:left&#34;&gt;v3.9, v3.8, v3.7&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td style=&#34;text-align:right&#34;&gt;Java&lt;/td&gt;
    &lt;td style=&#34;text-align:left&#34;&gt;v8, v11&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td style=&#34;text-align:right&#34;&gt;C#&lt;/td&gt;
    &lt;td style=&#34;text-align:left&#34;&gt;.NET v5, v6   &amp;amp; .NET Core v3.1&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td style=&#34;text-align:right&#34;&gt;Go&lt;/td&gt;
    &lt;td style=&#34;text-align:left&#34;&gt;v1.x&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td style=&#34;text-align:right&#34;&gt;Ruby&lt;/td&gt;
    &lt;td style=&#34;text-align:left&#34;&gt;v2.7*&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td style=&#34;text-align:right&#34;&gt;&lt;a href=&#34;https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Custom Runtime&lt;/a&gt;&lt;/td&gt;
    &lt;td style=&#34;text-align:left&#34;&gt;- Based on Amazon Linux&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;tfoot&gt;
      &lt;tr&gt;
      &lt;th style=&#34;text-align:right&#34;&gt;&lt;/th&gt;
      &lt;th style=&#34;text-align:left&#34;&gt;&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/tfoot&gt;
&lt;/table&gt;
&lt;br&gt;
&lt;p&gt;&lt;em&gt;&lt;a href=&#34;https://github.com/micronaut-projects/micronaut-aws/blob/master/function-aws-custom-runtime/src/main/java/io/micronaut/function/aws/runtime/AbstractMicronautLambdaRuntime.java#L347&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Micronaut Custom Runtime Implementation Example&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&#34;lambda-function-java&#34;&gt;Lambda Function Java&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&#34;language-java&#34;&gt;public class MsgHandler implements RequestHandler&amp;lt;String, String&amp;gt; {
    public String handleRequest(String input, Context ctx) {
        context.getLogger().log(&amp;quot;Input: &amp;quot; + input);
        return &amp;quot;Hello World - &amp;quot; + input;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&#34;language-java&#34;&gt;public class StreamHandler implements RequestStreamHandler {
    public void handleRequest(InputStream is, OutputStream os, Context ctx) {
        String input = IOUtils.toString(is, &amp;quot;UTF-8&amp;quot;);
        os.write((&amp;quot;Hello World - &amp;quot; + input).getBytes());
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&#34;language-java&#34;&gt;public class NoInterfaceHandler {
    public String customHandle(String input, Context context) {
        context.getLogger().log(&amp;quot;Input: &amp;quot; + input);
        return &amp;quot;Hello World - &amp;quot; + input;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h3 id=&#34;features&#34;&gt;Features&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Automatically manages the underlying Compute Resources&lt;/li&gt;
&lt;li&gt;Concurrency and Scaling controls&lt;/li&gt;
&lt;li&gt;Pay Per Request Execution is millis&lt;/li&gt;
&lt;li&gt;Multiple Event Sources: API-GW, SQS, S3, DynamoDB, etc.&lt;/li&gt;
&lt;li&gt;Functions defined as Container Images&lt;/li&gt;
&lt;li&gt;Lambda Extensions&lt;/li&gt;
&lt;li&gt;Execute inside Private Subnets inside a VPC&lt;/li&gt;
&lt;li&gt;File Systems Access + EFS&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id=&#34;limitationshttpsdocsawsamazoncomlambdalatestdggettingstarted-limitshtml&#34;&gt;&lt;a href=&#34;https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Limitations&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Memory: 128 MB to 10,240 MB&lt;/li&gt;
&lt;li&gt;No Direct Way to assign CPU: 1,769 MB memory is equivalent of one vCPU&lt;/li&gt;
&lt;li&gt;Function Timeouts: 15 minutes&lt;/li&gt;
&lt;li&gt;Invocation Payload: 6 MB (sync) &amp;amp; 256 KB (async)&lt;/li&gt;
&lt;li&gt;File descriptors: 1024&lt;/li&gt;
&lt;li&gt;Execution processes/threads: 1024&lt;/li&gt;
&lt;li&gt;No Async Processing Allowed: Lambda Instance Freezes once invocation is completed&lt;/li&gt;
&lt;li&gt;1 Lambda Instance serves only 1 request at time&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&#34;other-compute-options&#34;&gt;Other Compute Options&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style=&#34;text-align:right&#34;&gt;Services&lt;/th&gt;
&lt;th style=&#34;text-align:left&#34;&gt;Comparison with Lambda&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:right&#34;&gt;AWS EC2&lt;/td&gt;
&lt;td style=&#34;text-align:left&#34;&gt;Not Serverless, More RAM/CPU/Storage, Always ON&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:right&#34;&gt;AWS EKS&lt;/td&gt;
&lt;td style=&#34;text-align:left&#34;&gt;Managed Container Platform on EC2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:right&#34;&gt;Fargate&lt;/td&gt;
&lt;td style=&#34;text-align:left&#34;&gt;Serverless Container Platform on EC2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:right&#34;&gt;Beanstalk&lt;/td&gt;
&lt;td style=&#34;text-align:left&#34;&gt;AWS Container based PaaS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&#34;text-align:right&#34;&gt;GCP Cloud RUN&lt;/td&gt;
&lt;td style=&#34;text-align:left&#34;&gt;Based on &lt;a href=&#34;https://knative.dev/docs/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;OSS Knative&lt;/a&gt; - Charged for Runtime only&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;hr&gt;
&lt;h1 id=&#34;questions&#34;&gt;Questions?&lt;/h1&gt;
</description>
    </item>
    
  </channel>
</rss>
