Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS DynamoDB TTL

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?

like image 250
micah Avatar asked Nov 26 '17 17:11

micah


People also ask

What is TTL on DynamoDB?

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.

Can we set TTL in DynamoDB?

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.

Is DynamoDB TTL in milliseconds?

Note: Be sure that the timestamp is in seconds, not milliseconds (for example, use 1572268323 instead of 1572268323000).

Is DynamoDB TTL reliable?

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.


1 Answers

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.

like image 76
Michael - sqlbot Avatar answered Oct 17 '22 23:10

Michael - sqlbot