Cost-optimizing short-lived contest workloads with DynamoDB TTL and Lambda
Short answer
D Migrate entries to DynamoDB, rewrite the logic as Lambda, and set a DynamoDB TTL to expire entries at contest end, with no always-on cost.
Question
Key Takeaways
For variable-length, short-lived workloads, serverless DynamoDB plus Lambda and a TTL to auto-expire entries eliminates both compute idle cost and manual cleanup, which is cheaper than provisioned RDS/Redshift or a DAX cluster.
A contest app needs the lowest cost and no data retention after each contest. Migrating entries to DynamoDB, rewriting the selection logic as Lambda functions, and setting a DynamoDB TTL to expire entries at contest end removes always-on infrastructure and storage cost.
Common mistake: Adding a DAX cluster (Option A) — it is provisioned, always-on, and unnecessary for a simple low-latency read pattern, increasing cost contrary to the requirement.
Expert Analysis
Why the Answer Is Correct
Option D migrates storage to DynamoDB (pay-per-request, no idle cost), runs the winner-selection logic as Lambda (no servers to run between contests), and uses DynamoDB TTL to expire entries automatically at contest end, meeting the no-retention rule with minimal cost.
Why the Other Options Are Wrong
Option A adds DAX, a provisioned accelerator that raises cost with no benefit here. Option B uses Redshift, which is heavy and overkill for simple contest entries. Option C keeps RDS with ElastiCache, still provisioned and more expensive than serverless DynamoDB.
Community Comment Notes
m1xa (likes 6) favors Lambda plus TTL because the contest is a short-term task. SIJUTHOMASP notes cost is the only concern and DAX is unnecessary. The vote is D (65) over A (35).
Official Reference
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html
This link opens the official vendor documentation in a new tab.
Community Votes
65% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 21 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 21
-
m1xa 👍 6 Answered DLambda for choosing a winner (it's a short-term task) and TTL (known before the contest starts) make sense.
-
nharaz 👍 4 Answered DD is the most cost-effective solution. It leverages DynamoDB for efficient, scalable storage with automatic data expiration via TTL and AWS Lambda for flexible, event-driven processing. This setup minimizes costs by using resources only when needed and automatically scaling to match demand without the need for manual intervention or over-provisioning.
-
zouwelaar 👍 4 Answered AYou are forgetting that the contests run for variable lengths of time. So Lambda and TTL are out.
-
pangchn 👍 4 Answered AVote for A here reason as specified by zouwelaar
-
bjexamprep 👍 3 Answered AThe question is looking for “MOST cost-effectively”. I assume DAX + DynamoDB is cheaper than DynamoDB only. Cause DAX should be able to reduce the RCU cost and improve performance. This is an online contest, which means the RCU could be very high. "the contests run for variable lengths of time" means you can't set a fix TTL for the record entry. And even you can have a fix time, the record being submitted 1 min before the deadline will still be kept for the TTL and keep generating cost.
Show 16 more comments
-
duriselvan 👍 3Time To Live (TTL) for DynamoDB is a cost-effective method for deleting items that are no longer relevant. TTL allows you to define a per-item expiration timestamp that indicates when an item is no longer needed. DynamoDB automatically deletes expired items within a few days of their expiration time, without consuming write throughput.
-
trungtd 👍 3 Answered D"the contests run for variable lengths of time" does not mean that those time periods are not known. We do not need a fixed value for TTL but can use Lambda to change timestamp depending on each contest.
-
master9 👍 2 Answered Dhe most cost-effective solution would be to use AWS Lambda for processing the contest data and selecting a winner. AWS Lambda is a serverless compute service that runs your code in response to events and automatically manages the underlying compute resources. DynamoDB is a key-value and document database that delivers single-digit millisecond performance at any scale. It’s a fully managed, multiregion, multimaster, durable database with built-in security, backup and restore, and in-memory caching for internet-scale applications
-
red_panda 👍 2 Answered ACorrect option is A here. First of all, we don't know how much time the contest will last as per requirements, so fix the TTL it's a mistake. Second point, we can delete the entire table as we didn't the file after the end of the context, so no data to retain. Finally, for web contest, we don't know how much users will be online, and providing a cache layer might be a good solution.
-
9f02c8d 👍 2Option D, The option A doesn't fulfill the requirement of cost effectiveness as there is no reason to use DAX
-
Training 👍 2Should be A. With Variable lengths of time, Lambda is not the right choice.
-
tushar321 👍 2D. There is no in memory cache requirement here for DAX. So omitting A
-
kejam 👍 2 Answered DAnswer D: Seems to be the MOST cost-effective solution
-
Moghite 👍 2 Answered DOption D is the most cost Efficient
-
AzureDP900 👍 1Option D Migrate Storage: Migrating storage from RDS DB instances (which require a significant upfront cost) to DynamoDB (a fully managed NoSQL database service with low usage-based costs) will significantly reduce the company's expenses. Lambda Functions: Rewriting code as AWS Lambda functions (serverless computing for code execution) will eliminate the need for EC2 instances, reducing costs even further. Lambda functions are also ideal for tasks that run infrequently or have short durations. DynamoDB TTL Attribute: By using DynamoDB's TTL attribute to expire each entry at the end of the contest, the company can automatically clean up unused data without requiring manual deletion.
-
tonytam1991 👍 1 Answered AThis is what I hate AWS keep using impractical examples or unclear assumptions on their exam, it just train a lot of people just know yelling: "lambda is cheap, lambda is efficiency".
-
SIJUTHOMASP 👍 1 Answered DHere cost is the only concern and not performance, option A can be ruled out because no DAX is required. Simply Dynamo DB in option D would be more than sufficient.
-
vip2 👍 1 Answered Aremove entire DynamoDB and DAX is used for reduce RCU
-
TheCloudGuruu 👍 4 Answered DLambda to save cost
-
titi_r 👍 2 Answered DD - correct.
-
career360guru 👍 2 Answered DOption D
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All SAP-C02 Questions
Access 85 questions with complete answers and detailed explanations.
View Full SAP-C02 Practice Test →