You plan to develop a new application using AWS Lambda Function to process messages in Amazon SQS standard & FIFO queue.
Your Team lead is concerned about scaling of AWS Lambda function triggered by Amazon SQS message as event source.
Which of the following is used by AWS Lambda for scaling?
Click on the arrows to vote for the correct answer
A. B. C. D.Correct Answer - D.
In the case of Standard queue, AWS Lambda uses long polling to poll queues, & once messages are available it sends them to Lambda function.
In the case of FIFO queues, it has a message group ID that ensures messages in the same group are delivered to AWS Lambda.
Option A is incorrect.
For FIFO queues AWS Lambda uses message group ID for scaling & not short polling.
Option B is incorrect.
For FIFO queues AWS Lambda uses message group ID for scaling & not long polling.
Also, for standard queues, long polling is used for scalability.
Option C is incorrect.
For standard queue, AWS Lambda uses long polling for scaling.
For more information on AWS Lambda with Amazon SQS, refer to the following URLs-
https://aws.amazon.com/blogs/compute/new-for-aws-lambda-sqs-fifo-as-an-event-source/ https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.htmlWhen AWS Lambda is triggered by an event source such as Amazon SQS, it automatically scales to process the incoming events. AWS Lambda uses a combination of long polling and short polling to scale the function for both standard and FIFO queues.
Long polling is used for Amazon SQS standard queues, which helps reduce the number of empty responses by allowing AWS Lambda to wait for a specified period of time for messages to arrive. With long polling, AWS Lambda can retrieve messages from the SQS queue as soon as they become available, which helps to reduce the number of requests to Amazon SQS.
On the other hand, short polling is used for Amazon SQS FIFO queues, which is a simple and efficient way to retrieve messages from the queue. AWS Lambda checks the SQS queue for messages at a regular interval and retrieves the messages that are available at that time.
In addition to short polling, AWS Lambda also uses message group ID in case of Amazon SQS FIFO queues. When a message is sent to an Amazon SQS FIFO queue, it is assigned a message group ID that is used to ensure that messages are processed in the order they are received within each message group. This helps ensure that the order of processing is maintained even when multiple messages are being processed in parallel.
Therefore, the correct answer is option D. AWS Lambda uses long polling in case of standard queue and message group ID in case of FIFO queue to scale the function triggered by Amazon SQS message as an event source.