Hey everyone! I've set up a DynamoDB table and enabled Time to Live (TTL), added a field for expiration, and ran some simulations. According to that, two records are supposed to be deleted after 'X' amount of time. However, 'X' time has passed, and I still see those records. It's been less than an hour since I activated TTL. Can anyone tell me how long it actually takes for DynamoDB to delete records based on TTL?
4 Answers
Items with expired TTL attributes can be deleted at any time, usually within a few days of their expiration. So don’t worry too much about it yet! Just keep an eye on it for a couple more days.
To manage your records better, consider using a filter expression in your queries, so you only retrieve valid records and avoid confusion with the expired ones!
TTL management is done as a background process in DynamoDB. It might only get enforced when things like partition keys are restructured, which means there’s no set timeframe for deletion. Always check your items’ TTL in your app as a fail-safe!
Yeah, when they say 'within a few days', they mean it! It usually doesn't take that long, but don't expect immediate deletion right after the TTL hits. Just make sure to check if the item still exists based on the current time vs. the TTL timestamp for more accurate handling.
Definitely! It's safer to verify whether items have actually expired before assuming they've been deleted.
Good point! That's a smart approach to ensure you’re not relying solely on TTL for data validity.