Cost-optimizing short-lived contest workloads with DynamoDB TTL and Lambda
A company uses a mobile app on AWS to run online contests. The company selects a winner at random at the end of each contest. The contests run for variable lengths of time. The company does not need to retain any data from a contest after the contest is finished. The company uses custom code that is hosted on Amazon EC2 instances to process the contest data and select a winner. The EC2 instances run behind an Application Load Balancer and store contest entries on Amazon RDS DB instances. The company must design a new architecture to reduce the cost of running the contests. Which solution will meet these requirements MOST cost-effectively?
Community Votes
65% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
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.
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.
Community Discussion (21 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
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
Related Analysis
Practice All SAP-C02 Questions
Access 85 questions with complete answers and detailed explanations.
View Full SAP-C02 Practice Test →