Optimizing Lambda performance using /tmp directory caching
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?
Community Votes
100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
This question tests the use of Lambda's ephemeral
/tmpstorage for performance optimization, while the common trap is assuming the Amazon Translate API offers a built-in caching feature.
Caching translated content in the Lambda /tmp directory significantly reduces database load and API latency for recurring requests. The community consensus identifies this as the only viable option among the choices to improve response time without modifying the database.
Selecting "Enable TranslateText API caching" is a common mistake because it assumes a feature that does not exist in the Amazon Translate service.
Community Discussion (4 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Option B is correct because caching the translated output in the/tmp directory allows subsequent Lambda invocations within the same execution context to retrieve data instantly without querying the database or calling the Translate API. Since the newsletter is updated daily, the content remains static for extended periods, making repeated processing inefficient. This approach directly addresses the requirement to improve response time and reduce database load without altering the database infrastructure.Why the Other Options Are Wrong
Option A is incorrect because asynchronous invocation is not suitable for a synchronous website request where the user expects an immediate response. Option C is incorrect because Amazon Translate does not provide a native, toggleable API-level caching feature. Option D is incorrect because the workflow is linear (fetch then translate), and parallel processing would not reduce the inherent latency of the database query or translation service.Community Comment Notes
Commenters confirm that B is the only logical choice, noting that while/tmp is ephemeral, it is the only caching mechanism available among the options. One commenter pointed out that while AWS recommends S3 or DynamoDB for more robust caching layers, using /tmp is the intended answer within the constraints of the provided options. Official Reference
Exam Strategy
When facing performance bottlenecks involving static or slowly changing data, prioritize caching strategies. Be skeptical of options that suggest enabling non-existent service features, such as native caching for Amazon Translate.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →