DVA-C02 · Question #187
A mobile app stores blog posts in an Amazon DynamoDB table. Millions of posts are added every day, and each post represents a single item in the table. The mobile app requires only recent posts. Any…
The correct answer is D. For each item, add a new attribute of type Number that has a timestamp that is set to 48 hours. Solution (D) is the most cost-effective because it uses DynamoDB's Time to Live (TTL) to automatically remove expired items. The TTL is an item attribute that specifies the duration of time that an item should remain in the table. When an item's TTL expires, the item is…
Question
A mobile app stores blog posts in an Amazon DynamoDB table. Millions of posts are added every day, and each post represents a single item in the table. The mobile app requires only recent posts. Any post that is older than 48 hours can be removed. What is the MOST cost-effective way to delete posts that are older than 48 hours?
Options
- AFor each item, add a new attribute of type String that has a timestamp that is set to the blog post
- BFor each item, add a new attribute of type String that has a timestamp that is set to the blog post
- CFor each item, add a new attribute of type Date that has a timestamp that is set to 48 hours after
- DFor each item, add a new attribute of type Number that has a timestamp that is set to 48 hours
How the community answered
(43 responses)- A5% (2)
- B2% (1)
- C9% (4)
- D84% (36)
Explanation
Solution (D) is the most cost-effective because it uses DynamoDB's Time to Live (TTL) to automatically remove expired items. The TTL is an item attribute that specifies the duration of time that an item should remain in the table. When an item's TTL expires, the item is automatically deleted from the table.
Community Discussion
No community discussion yet for this question.