All Products
Search
Document Center

Time Series Database:Configure data retention policies

Last Updated:Mar 28, 2026

Retention policies control how long TSDB for InfluxDB®️ keeps data in a database. By default, every database starts with a policy called autogen that stores data permanently and keeps shards for seven days. Create custom policies to limit storage duration, manage storage costs, or support multiple data lifecycles within the same database.

Prerequisites

Before you begin, ensure that you have:

How retention policies work

A retention policy defines two independent time dimensions:

DimensionDescriptionDefault (autogen)
Storage durationHow long data is kept in the databasePermanent (no expiry)
Shard durationHow long individual shards are retained7 days

A database can have multiple retention policies, but only one can be the default at a time. When you set a custom policy as the default, autogen is no longer the default.

Get to the Storage Policy Management page

All retention policy operations start from the same page. Before following the steps in any section below, open the Storage Policy Management page for your database:

  1. Log on to the TSDB console.

  2. In the upper-left corner, select the region where your instance is located.

  3. On the Instances page, click Manage in the Actions column for your instance.

  4. Choose Time Series Data Management > Databases. On the Databases page, click Storage Policy Management in the Actions column for your database.

Create a retention policy

  1. On the Storage Policy Management page, click Create in the upper-right corner.

    image..png

  2. In the dialog box, configure the following parameters.

    ParameterDescription
    Retention Policy NameA unique name for the policy.
    Storage DurationHow long data is retained in the database.
    defaultWhether to set this policy as the default. When enabled, autogen is no longer the default. A database can have only one default policy at a time.
  3. Click OK.

You can also configure the Storage Duration of Shards parameter by modifying an existing retention policy after creation. For more information, see Modify a retention policy.

Modify a retention policy

  1. On the Storage Policy Management page, select the policies to modify:

    • Single policy: Click Modify in the Actions column for the policy.

    • Multiple policies: Select the policies, then click Modify Selected.

    When modifying multiple policies at once, only the Storage Duration parameter is available. To update the Storage Duration of Shards, modify each policy individually.
  2. In the dialog box, update the parameters.

  3. Click OK.

Set the default retention policy

  1. On the Storage Policy Management page, click Set As Default in the Actions column for the policy.

After the change, Yes appears in the Whether Is default column for that policy.

Delete a retention policy

  1. On the Storage Policy Management page, click Delete in the Actions column for the policy you want to remove.

  2. In the confirmation dialog, click OK.