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 automatically deletes items shortly after they expire (typically within a few days), 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.
  • Not instant — DynamoDB typically removes expired items within a couple of 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.

Common uses

Sessions, verification tokens, caches, and other ephemeral data that should self-clean. 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.

Trabaja con DynamoDB sin la Consola

DynoTable es un cliente de escritorio rápido para DynamoDB: explora tablas, ejecuta consultas estilo SQL y edita Items localmente.