Does DynamoDB support TTL?

Yes. DynamoDB supports Time to Live (TTL). You designate a Number attribute holding a Unix epoch expiry timestamp in seconds; DynamoDB then removes expired items in the background — typically within a few days of expiry — at no extra cost and without consuming write capacity. Expired-but-not-yet-deleted items can still appear in reads until removed.

How to enable it

Turn on TTL for the table and name the attribute that holds the expiry. That attribute must be a Number storing a Unix epoch timestamp in seconds (not milliseconds). Items whose value is in the past become eligible for deletion.

What to expect

  • Free — the automatic delete does not consume write capacity units. Doing the same cleanup yourself costs a write unit per item: ten million expired 1 KB items is ten million write units, $6.25 in us-east-1 on-demand, plus about $1.64 for each full scan over a 100 GB table to find them. (One exception: on a global table, the delete replicated to each other Region does consume replicated write capacity there.)
  • Not instant — DynamoDB typically removes expired items within a few days of expiry.
  • Still readable — until they are physically deleted, expired items can appear in reads, queries, and scans, so filter them out if exactness matters.

The way it silently never fires

DynamoDB does not validate the attribute you pointed TTL at. Both of these writes returned HTTP 200 on a table with TTL enabled on expiresAt, and neither item will ever expire:

{"pk": {"S": "sess#1"}, "expiresAt": {"S": "1790812800"}}
{"pk": {"S": "sess#2"}, "expiresAt": {"N": "1790812800000"}}

The first stores the timestamp as a String. AWS is explicit that "items with a TTL attribute that is not a Number type are ignored by the TTL process", and nothing tells you at write time, at enable time, or afterwards.

The second is the one that actually happens, because the type is right and the value came from Date.now(). 1790812800000 is 1 October 2026 in milliseconds. Read as seconds, which is the only way TTL reads it, that timestamp lands in the year 58718. The item is well-formed, queryable, billed for storage, and scheduled to expire in fifty-six thousand years.

Nothing in the API surfaces either mistake, so the check has to happen before you write. Our TTL converter treats any value above 1e12 as milliseconds for this reason, and shows you the date the value resolves to.

Common uses

Session records, verification tokens, and cached results that should clean themselves up — the classic TTL use cases. Pair with DynamoDB Streams to react to deletions.

Go deeper

Read the DynamoDB TTL guide and DynamoDB Streams. Download DynoTable to view and set TTL attributes.

References

Last verified 2026-07-13 against the official AWS documentation linked above; TTL.html re-checked 2026-07-28.

Both writes above were run 2026-07-28 against DynamoDB Local 3.3.0 via @aws-sdk/client-dynamodb 3.1095.0 and were accepted with HTTP 200. Cleanup costs computed from the us-east-1 on-demand rates in our synced AWS pricing table.

Work with DynamoDB without the Console

A fast DynamoDB desktop client that runs the real SQL DynamoDB can’t — JOINs, GROUP BY, aggregates — with visual editing and an AI agent on your own Bedrock keys.

Free 30-day trial, no credit card — then the Free plan with no time limit.