I'm having trouble getting AWS DynamoDB TTL to work. I set my ttl attribute to ttl
, and set ttl
on all of my rows to 0
. I did this 6 days ago but I still have rows in my db with ttl set to 0
.
Does setting ttl to 0 not work?
Amazon DynamoDB Time to Live (TTL) allows you to define a per-item timestamp to determine when an item is no longer needed. Shortly after the date and time of the specified timestamp, DynamoDB deletes the item from your table without consuming any write throughput.
Choose Tables, and then choose the table that you want to modify. In the Additional settings tab, in the Time to Live (TTL) section, choose Enable. In the Enable Time to Live (TTL) page, enter the TTL attribute name. (Optional) To preview some of the items that will be deleted when TTL is enabled, choose Run preview.
Note: Be sure that the timestamp is in seconds, not milliseconds (for example, use 1572268323 instead of 1572268323000).
TTL precisionDynamoDB typically deletes expired items within 48 hours of expiration. The exact duration within which an item truly gets deleted after expiration is specific to the nature of the workload and the size of the table.
A TTL value of 0
doesn't work, according to this:
Items with an expiration time greater than 5 years in the past are not deleted.
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/time-to-live-ttl-before-you-start.html
The TTL value is the time in Unix Epoch format, where 0
means 1970-01-01T00:00:00Z
-- more than 5 years in the past.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With