DVA-C02 · Question #392
DVA-C02 Question #392: Real Exam Question with Answer & Explanation
The correct answer is B: Cache the translated newsletters in the Lambda/tmp directory.. Caching translated newsletters in Lambda's /tmp directory works because Lambda containers are reused across warm invocations - once a newsletter is translated and stored in /tmp, subsequent requests served by that container skip both the database query and the Translate API call
Question
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?
Options
- AChange to asynchronous Lambda function invocation.
- BCache the translated newsletters in the Lambda/tmp directory.
- CEnable TranslateText API caching.
- DChange the Lambda function to use parallel processing.
Explanation
Caching translated newsletters in Lambda's /tmp directory works because Lambda containers are reused across warm invocations - once a newsletter is translated and stored in /tmp, subsequent requests served by that container skip both the database query and the Translate API call entirely, directly addressing the overloaded database and slow response time. Since newsletters only change daily, this cached content remains valid for many requests.
Why the distractors fail:
- A - Asynchronous invocation means fire-and-forget; the user's browser still needs a synchronous response with the newsletter content, so this doesn't help and breaks the use case.
- C - Amazon Translate has no built-in API-level caching feature; this option simply doesn't exist as an AWS capability.
- D - Parallel processing would increase concurrency, which actually worsens the overloaded on-premises database problem rather than relieving it.
Memory tip: Think of Lambda /tmp as a "per-container scratchpad" - warm containers reuse it, so caching read-heavy, low-change-rate content there is a classic Lambda optimization pattern. Whenever a question involves Lambda + repeated expensive lookups + slow-changing data, /tmp caching is usually the answer.
Topics
Community Discussion
No community discussion yet for this question.