AWS Certified Database – Specialty — Question 154

A company released a mobile game that quickly grew to 10 million daily active users in North America. The game's backend is hosted on AWS and makes extensive use of an Amazon DynamoDB table that is configured with a TTL attribute.
When an item is added or updated, its TTL is set to the current epoch time plus 600 seconds. The game logic relies on old data being purged so that it can calculate rewards points accurately. Occasionally, items are read from the table that are several hours past their TTL expiry.
How should a database specialist fix this issue?

Answer options

Correct answer: B

Explanation

The correct answer is B, as including a query filter expression allows the system to ignore any items that have exceeded their TTL, ensuring that only relevant data is processed. Option A does not directly address the issue of expired items being read. Option C merely affects read consistency but does not filter out expired items. Option D creates an index but does not solve the problem of retaining expired data in query results.