exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 367 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 367
Topic #: 1
[All AWS Certified Developer Associate Questions]

A developer migrated a legacy application to an AWS Lambda function. The function uses a third-party service to pull data with a series of API calls at the end of each month. The function then processes the data to generate the monthly reports. The function has been working with no issues so far.

The third-party service recently issued a restriction to allow a fixed number of API calls each minute and each day. If the API calls exceed the limit for each minute or each day, then the service will produce errors. The API also provides the minute limit and daily limit in the response header. This restriction might extend the overall process to multiple days because the process is consuming more API calls than the available limit.

What is the MOST operationally efficient way to refactor the serverless application to accommodate this change?

  • A. Use an AWS Step Functions state machine to monitor API failures. Use the Wait state to delay calling the Lambda function.
  • B. Use an Amazon Simple Queue Service (Amazon SQS) queue to hold the API calls. Configure the Lambda function to poll the queue within the API threshold limits.
  • C. Use an Amazon CloudWatch Logs metric to count the number of API calls. Configure an Amazon CloudWatch alarm that stops the currently running instance of the Lambda function when the metric exceeds the API threshold limits.
  • D. Use Amazon Kinesis Data Firehose to batch the API calls and deliver them to an Amazon S3 bucket with an event notification to invoke the Lambda function.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
JulietHsu
Highly Voted 2 years, 4 months ago
Selected Answer: B
I don't see how Step Functions will help this case. I would go with SQS and lambda
upvoted 6 times
pancman
2 years, 3 months ago
The maximum delay allowed in an SQS queue is 15 minutes. The question states that the job will take multiple days. So that wouldn't work.
upvoted 2 times
...
...
pancman
Highly Voted 2 years, 3 months ago
Selected Answer: A
A makes the most sense in this question: Use an AWS Step Functions state machine to monitor API failures. Use the Wait state to delay calling the Lambda function. SQS queue wouldn't work because the maximum delay allowed in an SQS queue is 15 minutes. Kinesis is more suitable for data streams, which is not the case here. C (CloudWatch) would work but it is not as efficient as A.
upvoted 5 times
joanneli77
2 years, 3 months ago
SQS Queue can just keep re-trying. Items can stay in a SQS Queue for 14 days. Delay timers are not relevant... Your lambda just fires off and tries again until the entire workload is complete. Answer is B. Queue until finished.
upvoted 2 times
...
...
a15ce96
Most Recent 1 year, 2 months ago
Selected Answer: B
A says: " Use the Wait state to delay calling the Lambda function". I don't like the fact we need to wait with no specific time boundaries. Option B with the statement of "to poll the queue within the API threshold limits" looks better.
upvoted 1 times
a15ce96
1 year, 2 months ago
Moreover, SQS is a cliche, the most common solution in such tests.
upvoted 1 times
...
...
LR2023
1 year, 5 months ago
why not C seems operationally efficient over setting up Step function and SQS
upvoted 1 times
...
pranay_2406
1 year, 12 months ago
Selected Answer: B
It's B By using an Amazon SQS queue, you can decouple the API calls from the Lambda function's execution and ensure that you stay within the API limits. Here's how the solution would work: 1. Set up an Amazon SQS queue to hold the API calls. This queue will act as a buffer, allowing you to control the rate at which the API calls are made. 2. Configure the Lambda function to periodically poll the Amazon SQS queue for messages. You can use the AWS SDK or AWS Lambda triggers to trigger the function when there are messages in the queue. 3. Within the Lambda function, retrieve the API calls from the queue and make the necessary API requests to the third-party service. Ensure that the Lambda function respects the API threshold limits for each minute and each day.
upvoted 2 times
pranay_2406
1 year, 12 months ago
4. After processing each API call, delete the message from the Amazon SQS queue to indicate that it has been processed successfully. By implementing this solution, the Lambda function will only make API calls within the allowed limits, preventing errors and ensuring smooth operation. The use of Amazon SQS provides a scalable and reliable queueing system, allowing you to handle varying API call rates and accommodate the restrictions imposed by the third-party service. Therefore, the most operationally efficient approach is to refactor the application using an Amazon SQS queue to control the rate of API calls made by the Lambda function.
upvoted 1 times
...
...
sdafadsfa
2 years, 1 month ago
Selected Answer: B
use plze SQS
upvoted 1 times
...
sdafadsfa
2 years, 1 month ago
Selected Answer: B
use SQS
upvoted 1 times
...
Ankit1010
2 years, 3 months ago
B Using an Amazon SQS queue to hold the API calls is the most operationally efficient way to refactor the serverless application to accommodate this change. The Lambda function can poll the queue for messages within the API threshold limits. This allows the function to process the data and generate reports without exceeding the API limits. If the number of messages in the queue is higher than the limit, then the function can be configured to stop processing new messages until the number of messages in the queue decreases.
upvoted 1 times
Ankit1010
2 years, 3 months ago
Option A is not the most efficient way because AWS Step Functions incur additional costs and add complexity to the overall architecture. The Wait state might cause the function to execute beyond the necessary time window, leading to higher costs. Option C is not a suitable solution because it involves stopping the function during execution, which is not an efficient way to handle the situation. Option D is not a suitable solution because it adds an extra layer of complexity by introducing Amazon Kinesis Data Firehose. This option may also require additional resources, which might increase the cost.
upvoted 1 times
...
...
Smartiup
2 years, 3 months ago
Selected Answer: A
Will go with step function. It will cover the scenario where the minute and day limit change during the execution of the job.
upvoted 1 times
...
Phinx
2 years, 3 months ago
Selected Answer: C
I'll go with C. SQS is not efficient in this scenario.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...