October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

DynamoDB TTL: When Expired Items Actually Disappear

DynamoDB TTL makes items eligible for background deletion; it does not remove them at the expiration timestamp. Filter expired records in your application when they must no longer appear.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

DynamoDB TTL does not delete an item at its expiration timestamp. It marks the item as eligible for asynchronous deletion, which AWS says typically happens within a few days—but is not guaranteed by that deadline. Until deletion completes, an expired item may still be returned by reads and continues to count toward storage and read costs. If an expiration deadline matters to your application, enforce it in your own read and write logic; use TTL for eventual cleanup.

What the TTL timestamp means

Time to Live (TTL) is a DynamoDB cleanup mechanism. You enable it for a table, choose the attribute DynamoDB should inspect, and store an expiration value on each item that should expire. That value must be a Number containing Unix epoch time in seconds. Values stored as another data type are ignored by TTL.

As an Amazon Associate I earn from qualifying purchases.

When the timestamp passes, the item becomes eligible for deletion. DynamoDB finds eligible items in the background and deletes them asynchronously. AWS says deletion can happen at any time and typically occurs within a few days; it is not a real-time deadline or a promise that the item will be removed by a particular time. Timing can vary with table size and activity. AWS’s TTL guide describes the configuration and timing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why an expired item may still appear

An item whose TTL timestamp has passed can remain in the table while DynamoDB’s deletion process is pending. During that period, it can still be read, queried, scanned, or written. Expiration alone does not make DynamoDB hide the item from application results.

#1 Best Overall

Pending expired items also continue to count toward storage and read costs until DynamoDB deletes them, as AWS explains in its guide to working with expired items. Do not treat the timestamp as an access-control boundary, a guarantee of immediate removal, or a way to avoid those costs as soon as the deadline passes.

Keep expired records out of application results

Filter Query and Scan results

If expired items must not be shown or used, check their TTL attribute in application logic and exclude items whose expiration time has passed. Apply that check to results from both Query and Scan operations. TTL will still remove the items eventually, but the application-side filter controls what your application accepts during the delay.

Protect writes against a pending deletion

An expired item may still exist when an update runs—or DynamoDB may delete it before the operation completes. Use a conditional expression for updates that depend on the item still being present or valid. This makes the write handle the possibility of concurrent TTL deletion rather than assuming the expired record will remain available.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Streams for downstream deletion work

DynamoDB Streams can expose TTL deletions for downstream processing, such as archival or other cleanup work. In the Region where the deletion occurs, the stream identifies the TTL deletion as a service action by DynamoDB. With Global Tables, a replicated deletion in another Region is not identified as a TTL deletion in that replica Region’s stream. See AWS’s guidance on TTL deletion records and expired items before relying on stream records across Regions.

For current-version Global Tables, TTL deletions replicate to replica tables. The initial TTL deletion does not consume write capacity in the Region where expiration occurs, but replicated deletes can consume replicated write capacity in replica Regions, and applicable charges may apply. Include that regional replication work when estimating cleanup costs.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

TTL is cleanup, not recovery

TTL is for eventual removal of expired data; it does not provide a way to recover information after deletion. DynamoDB point-in-time recovery (PITR) offers continuous backups with a configurable recovery window of one to 35 days. Restoring with PITR creates a new table. On-demand backups are a separate full-table backup option that can support longer-term retention. Choose a backup method when recovery is required, rather than relying on TTL. See AWS documentation for PITR and on-demand backups.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.