Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DynamoDB TTL: when are items removed

According to the docs:

DynamoDB 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

Is there any way we can estimate how long it would take for an expired item to be removed in certain table? I was hoping to implement sort of a scheduler based on a DynamoDB table with TTL and a Lambda function processing DynamoDB Streams, but I would need deletions to take effect not later than one hour after an item is expired. Would this be possible if the table is not large (less than 1.000 items)?

like image 510
davids Avatar asked Apr 28 '17 11:04

davids


People also ask

How does TTL work in 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.

Is DynamoDB TTL real time?

What is DynamoDB TTL? DynamoDB allows you to specify a time-to-live timestamp attribute in an epoch timestamp format to define when the item is no longer needed. This attribute will tell DynamoDB to remove items whose TTL attribute is later than current time.

How long does DynamoDB take to delete?

TTL typically deletes expired items within 48 hours of expiration.

How long is eventually consistent DynamoDB?

The data is eventually consistent across all storage locations, usually within one second or less. DynamoDB supports eventually consistent and strongly consistent reads. When you read data from a DynamoDB table, the response might not reflect the results of a recently completed write operation.


1 Answers

The exact timing of deletions is not something you should take a hard dependency upon. As DynamoDB TTL uses background I/O capacity to process the deletions (which saves the customer money and preserves their provisioned IOPS to be available for their application), this will depend on what else is going on in the system, which can vary.

like image 200
user1352056 Avatar answered Nov 08 '22 08:11

user1352056