Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

I'm trying to understand whether I need SQS in my workflow if someone can help explain. In my app, when an action is taken, it submits info to SNS topic which invokes LAMBDA to do some processing. This is working great as it is.

When I do research online, it seems that people are using SQS in this stack as well where SNS would put info on SQS and then SQS would then invoke LAMBDA.

I guess what I'm trying to understand is the need for SQS in this. What value doe that adds or in other words, what am I losing by invoking my LAMBDA directly from SNS?

1 Answer

0 votes
by (44.4k points)

If you have SQS in between SNS and Lambda, it can be useful for reprocessing. For example, if Lambda fails to process an event, then you can increase the memory or increase the timeout and you will be able to reprocess the older events.

If you are using SNS directly with Lambda, then if Lambda fails an event, that particular event is lost. If you want all of your events processed, then go for SNS - SQS - Lambda. If not required, then go with SNS - Lambda.

Also, SQS can be used as a Lambda Trigger now, whenever a new item enters the queue the Lambda function is triggered.

Related questions

0 votes
1 answer

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...