65. Solving SQS and Lambda concurrency problems
AWS Bites26 Tammi 2023

65. Solving SQS and Lambda concurrency problems

In this episode of the AWS Bites Podcast, we dive into the serverless pattern of using AWS Lambda together with SQS. We explain the basics of both Lambda and SQS for those who may not be familiar with them. We talk about how we use Lambda, a Function as a Service offering in AWS, to write our own functions and have AWS run them in response to certain events. And we also discuss SQS, a scalable and managed queuing system available on AWS, which we use to offload work to background workers.

We delve into how the two services work together through the use of "Event Source Mapping" in Lambda, which polls our SQS queue and makes synchronous Lambda invocation requests when messages are available. We also mention how this feature provides us with the ability to control batch size and window, as well as specify filters to save execution time and cost. But we also share one of the limitations we faced when using SQS and Lambda together which was the lack of control over concurrency and the potential for excessive throttling.

But recently, AWS has released a new feature called "SQS maximum concurrency support" which allows us to specify a maximum number of invocations for an Event Source Mapping. This solves the problem of excessive throttling and eliminates the need to use reserved concurrency. It also allows for more control over concurrency when using multiple Event Source Mappings with the same function. We explain how this new feature has improved our workflow and made it much more efficient.

💰 SPONSORS 💰

AWS Bites is sponsored by fourTheorem, an AWS Consulting Partner offering training, cloud migration, and modern application architecture.

In this episode, we mentioned the following resources:

You can listen to AWS Bites wherever you get your podcasts:

Do you have any AWS questions you would like us to address? Leave a comment here or connect with us on Twitter:

#AWS #rust #lambda

Jaksot(157)

121. 5 Ways to extend CloudFormation

121. 5 Ways to extend CloudFormation

In this episode, we discuss 5 different ways to extend CloudFormation capabilities beyond what it natively supports. We started with a quick recap of what CloudFormation is and why we might need to ex...

18 Huhti 202430min

120. Lambda Best Practices

120. Lambda Best Practices

In this episode, we discuss best practices for working with AWS Lambda. We cover how Lambda functions work under the hood, including cold starts and warm starts. We then explore different invocation t...

4 Huhti 202426min

119. The state of AWS 2024 (AnsWeRS community survey commentary)

119. The state of AWS 2024 (AnsWeRS community survey commentary)

In this episode, we provide commentary and analysis on the 2024 AWS Community Survey results. We go through the key findings for each area including infrastructure as code, CI/CD, serverless, containe...

22 Maalis 202439min

118. The landing zone: Managing multiple AWS accounts

118. The landing zone: Managing multiple AWS accounts

In this episode, we provide an introductory overview of AWS's best practices for managing infrastructure using multiple accounts under an organization. We discuss the advantages of this approach and h...

15 Maalis 202425min

117. What do EBS and a jellyfish have in common?

117. What do EBS and a jellyfish have in common?

In this episode, we provide an overview of Amazon EBS, which stands for Elastic Block Storage. We explain what block storage is and how EBS provides highly available and high-performance storage volum...

8 Maalis 202421min

116. What is RAM (Resource Access Manager)?

116. What is RAM (Resource Access Manager)?

In this episode, we discuss AWS Resource Access Manager (RAM) and how it can be used to securely share AWS resources like VPC subnets, databases, and SSM parameters across accounts. We explain the ben...

1 Maalis 202413min

115. What can you do with Permissions Boundaries?

115. What can you do with Permissions Boundaries?

In this episode, we discuss Permission Boundary policies in AWS IAM. A permissions boundary is an advanced feature in which you set the maximum permissions that an identity-based policy can grant to a...

23 Helmi 202413min

114. What's up with LLRT, AWS' new Lambda Runtime?

114. What's up with LLRT, AWS' new Lambda Runtime?

In this episode, we discuss the new experimental AWS Lambda LLRT Low Latency runtime for JavaScript. We provide an overview of what a Lambda runtime is and how LLRT aims to optimize cold starts and pe...

16 Helmi 202430min