Which solution meets these requirements?
Configure a TTL attribute for the leaderboard data.
Use DynamoDB Streams to schedule and delete the leaderboard data.
Use AWS Step Functions to schedule and delete the leaderboard data.
Set a higher write capacity when the scheduled delete job runs.
Explanations:
Configuring a TTL (Time to Live) attribute for the leaderboard data allows DynamoDB to automatically delete items after a specified time. This eliminates the need for a scheduled delete job, reducing the risk of throttling during peak write periods, as the deletion happens automatically in the background.
While DynamoDB Streams can capture changes to items in the table, they do not provide a mechanism to delete items directly. Using Streams would require additional processing to trigger deletions, which does not address the throttling issue effectively.
AWS Step Functions can orchestrate workflows, including scheduling deletions, but this approach introduces unnecessary complexity and does not solve the underlying problem of write throughput throttling during deletion. It would still require a scheduled job, similar to the current implementation.
Increasing the write capacity during the scheduled delete job might temporarily alleviate throttling, but it is not a long-term solution. This approach could lead to increased costs and does not optimize the deletion process itself, which could still interfere with normal operations during peak times.