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 120 discussion

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

A company has a website that displays a daily newsletter. When a user visits the website, an AWS Lambda function processes the browser's request and queries the company's on-premises database to obtain the current newsletter. The newsletters are stored in English. The Lambda function uses the Amazon Translate
TranslateText API operation to translate the newsletters, and the translation is displayed to the user.
Due to an increase in popularity, the website's response time has slowed. The database is overloaded. The company cannot change the database and needs a solution that improves the response time of the Lambda function.
Which solution meets these requirements?

  • A. Change to asynchronous Lambda function invocation.
  • B. Cache the translated newsletters in the Lambda /tmp directory.
  • C. Enable TranslateText API caching.
  • D. Change the Lambda function to use parallel processing.
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
JOL86
Highly Voted 2 years, 5 months ago
I'm not sure how making it asynchronous would work? The user needs to call the Lambda and get the translated newsletter back. Making it async wouldn't improve performance of doing that. Same with the database being overloaded. If we add parallel processing, the database will still be overloaded. I also don't think the TranslateText API has caching I'm thinking B as all the others don't make sense. Although caching with the /tmp directory seems a little strange, it can be used for that purpose as mentioned here: https://aws.amazon.com/blogs/compute/choosing-between-aws-lambda-data-storage-options-in-web-apps/
upvoted 12 times
gaddour_med
2 years ago
B will reduce calls to translate API not calls to database to get current newsletter. and the question asks for reducing database overload.
upvoted 2 times
...
...
VijayMandela
Most Recent 3 days, 17 hours ago
Selected Answer: D
I vote for D The Lambda/tmp directory is ephemeral storage, meaning it gets wiped after each execution. This storage would only be useful for caching within a single execution of Lambda but would not persist between invocations or for multiple users. Using Lambda’s ephemeral storage for caching is not ideal for this scenario because it does not scale across invocations and does not persist across Lambda executions. the question itself asking for improving the response time of the Lambda function and by using parallel processing we can do that there is nothing to do with (A)
upvoted 1 times
...
SD_CS
1 year ago
Selected Answer: B
Async will not help with the response time, also a callback would have to be set up. Caching seems much more logical as the same entries are likely to be requested multiple times.
upvoted 1 times
...
ninomfr64
1 year, 5 months ago
Selected Answer: B
A) Asynch invocations provides immediate success response, however client still need to wait for the Lambda function to complete to get the translated newsletter and the Lambda response time to retrieve the translation will not improve C) I think Amazon Translate does not provide caching D) I am not aware of a specific lambda capability named parallel processing, however increasing parallelism would not help here as the DB is already overwhelmed B) looks a bit strage, however /tmp provides a transient cache for data between invocations. Having a little bit of cache here can help both response time and database load
upvoted 1 times
...
rcaliandro
1 year, 7 months ago
Selected Answer: B
Since we don't want to modify the database, we have to think a solution lambda-side. Among the options, it makes sense to create a caching mechanism to store the translation in the /tmp directory. For me is B
upvoted 1 times
...
rlnd2000
1 year, 9 months ago
Selected Answer: B
B is suggesting use \temp as a cache directory for the DB, but some logic must be added to check if the newsletter is updated in the DB but anyway it is the best option for me.
upvoted 1 times
...
MrTee
1 year, 9 months ago
Selected Answer: B
Option B, cache the translated newsletters in the Lambda /tmp directory, is the most appropriate solution for this scenario. By caching the translated newsletters in the /tmp directory of the Lambda function, subsequent requests for the same newsletter can be retrieved from the cache instead of querying the database and performing translation again. This will reduce the load on the database and improve the response time of the Lambda function.
upvoted 1 times
...
sichilam
2 years ago
Why not enabling TranslateText API caching.?
upvoted 1 times
...
RyanDDD
2 years, 2 months ago
Selected Answer: B
We can use /tmp as temp cache for Lambda. https://aws.amazon.com/blogs/compute/choosing-between-aws-lambda-data-storage-options-in-web-apps/
upvoted 1 times
...
dark_cherrymon
2 years, 2 months ago
Selected Answer: B
B, so what if /tmp isn't shared you can redirect it to another lambda that does have it cached
upvoted 1 times
...
bont
2 years, 2 months ago
Selected Answer: B
Lambda doesn't share "/tmp" directory across multiple executions hence the application will return error if the execution context has expired since it won't be able to find the cache stored stored in the previous /tmp directory so the application will need to be dynamic to check if the cache exists or fetch it from the database.
upvoted 2 times
...
AulaitQM
2 years, 4 months ago
Selected Answer: B
I vote for B
upvoted 1 times
...
david00
2 years, 4 months ago
Selected Answer: B
Async only makes it slower, doesn't improve the db speed or page load
upvoted 1 times
...
Vinafec
2 years, 4 months ago
Selected Answer: B
Going with B. Why translate the same newsletter a potentially infinite number of times? Going async would respond faster, but without result.
upvoted 1 times
...
Danbraga
2 years, 5 months ago
Why not "D". It seems the same as A....
upvoted 2 times
...
Chhotu_DBA
2 years, 5 months ago
Selected Answer: A
asynchronous, A is correct
upvoted 1 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago