Which solution will meet these requirements with the LEAST development effort?
Create an AWS Lambda function to delete old user responses based on the expiration_date attribute. Create an Amazon EventBridge schedule to run the Lambda function daily.
Create an AWS Fargate task in Amazon Elastic Container Service (Amazon ECS) to delete old user responses based on the expiration_date attribute. Create an Amazon EventBridge schedule to run the Fargate task daily.
Create an AWS Glue job to delete old user responses based on the expiration_date attribute. Create an AWS Glue trigger schedule to run the job daily.
Enable TTL on the DynamoDB table and specify the expiration_date attribute. Expire old user responses by using DynamoDB TTL.
Explanations:
While using a Lambda function is a valid approach, it requires additional development effort to write and maintain the code for deleting expired items. The solution is more complex than necessary given DynamoDB’s built-in capabilities.
Using AWS Fargate for this task introduces unnecessary complexity and operational overhead. It requires the management of containerized services and additional code to implement the deletion logic, which is not needed for this use case.
AWS Glue is designed for data processing tasks, and using it for the deletion of items in DynamoDB is excessive for this requirement. It involves setting up a Glue job and trigger, which adds unnecessary complexity compared to simpler solutions.
Enabling TTL (Time to Live) on the DynamoDB table allows for automatic deletion of items based on the expiration_date attribute with no additional code or maintenance required. This solution directly meets the requirement with minimal development effort.