Q82 — AWS SAA-C03 Ch.14
Question 82 of 100 | ← Chapter 14
Q1082. An ecommerce company has an application that collects order-related information from customers. The company uses one Amazon DynamoDB table to store customer home addresses,phone numbers, and email addresses. Customers can check out without creating an account. The application copies the customer information to a secondDynamoDB table if a customer does create an account.The company requires a solution to delete personally identifiable information (PII) for customers who did not create an account within 28 days.Which solution will meet these requirements with the LEAST operational overhead?
- A. Create an AWS Lambda function to delete items from the first DynamoDB table that have a delivery date more than 28 days in the past.Use a scheduled Amazon EventBridge rule to run the Lambda function every day. ✓
- B. Update the application to store PII in an Amazon S3 bucket. Create an S3 Lifecycle rule to expire the objects after 28 days. Move the data to DynamoDB when a user creates an account.
- C. Launch an Amazon EC2 instance.Configure a daily cron job to run on the instance. Configure the cron job to use AWS CLI commands to delete items from DynamoDB.
- D. Use a createdAt timestamp to set TTL for data in the first DynamoDB table to 28 days.
Correct Answer: A. Create an AWS Lambda function to delete items from the first DynamoDB table that have a delivery date more than 28 days in the past.Use a scheduled Amazon EventBridge rule to run the Lambda function every day.
Explanation
To determine the solution with the LEAST operational overhead for deleting personally identifiable information (PII) for customers who did not create an account within 28 days, let's evaluate each option:A. Create an AWS Lambda function to delete items from the first DynamoDB table that have a delivery date more than 28 days in the past. Use a scheduled Amazon EventBridge rule to run the Lambda function every day.This option leverages serverless technology, specifically AWS Lambda and Amazon EventBridge. The Lambda function can efficiently process and delete items from DynamoDB, and the EventBridge rule ensures it runs daily with minimal manual intervention. This approach minimizes operational overhead. B. Update the application to store PII in an Amazon S3 bucket. Create an S3 Lifecycle rule to expire the objects after 28 days. Move the data to DynamoDB when a user creates an account.This option introduces complexity by involving an additional service (S3) and requires data movement between DynamoDB and S3. It also necessitates changes to the application to handle this data storage paradigm, which increases operational overhead.C. Launch an Amazon EC2 instance. Configure a daily cron job to run on the instance. Configure the cron job to use AWS CLI commands to delete items from DynamoDB.This option involves managing an EC2 instance, configuring a cron job, and ensuring the instance is secure and up-to-date. It adds significant operational overhead compared to serverless solutions. D. Use a createdAt timestamp to set TTL for data in the first DynamoDB table to 28 days.DynamoDB TTL (Time to Live) is an effective feature for automatically deleting items after a specified time. However, TTL is typically used for items that have a known, fixed lifespan upon creation. In this scenario, the lifespan (28 days) only applies if the customer does not create an account, which is a conditional rather than an inherent attribute. This makes TTL less suitable unless the application can reliably set and clear the TTL attribute based on account creation events.Given these considerations, the best solution with the LEAST operational overhead is:A. Create an AWS Lambda function to delete items from the first DynamoDB table that have a delivery date more than 28 days in the past. Use a scheduled Amazon EventBridge rule to run the Lambda function every day.This approach leverages AWS's serverless capabilities, minimizes manual intervention, and ensures the solution is scalable and cost-effective.