Development with AWS Services

A developer enables DynamoDB TTL on the expiresAt attribute, but expired items remain for weeks. The attribute contains ISO 8601 date strings. What should the developer change?

Show the answer

Correct answerA. Store expiresAt as a Number containing Unix epoch seconds

AWhy this is right: A numeric Unix epoch timestamp in seconds is the required TTL attribute representation.

BWhy not this: Read consistency does not change whether an attribute is valid for TTL processing.

CWhy not this: TTL does not require an index, and indexing does not fix an unsupported timestamp representation.

DWhy not this: TTL interprets the number as seconds, so a millisecond timestamp would indicate an expiration far in the future.

DynamoDB TTL requires the configured attribute to contain a Number representing Unix epoch time in seconds. Millisecond timestamps represent dates far in the future when interpreted as seconds.