InfluxDB: Configuring Data Retention in InfluxDB
This documentation is part of the Getting Started guide. You can view the complete guide here: How to quickly set up and manage InfluxDB using best practices.
👋 Welcome to the Stackhero documentation
Stackhero offers a fully managed InfluxDB cloud environment, designed for speed and simplicity:
- Unlimited writes, queries, dashboards, tasks, and buckets.
- Unlimited data retention: keep your metrics for as long as you need.
- Unlimited network and disk transfers, with no hidden limits.
- One-click updates: always benefit from the latest features and fixes.
- Consistent performance and enhanced security on your own private, dedicated infrastructure.
With Stackhero, you can focus on your data and analytics. Deploying InfluxDB cloud hosting only takes a few minutes, and every setup is optimized for long-term reliability.
By default, InfluxDB retains data indefinitely. For most time series use cases, setting a retention period for each bucket ensures you only keep the data you need and prevents uncontrolled storage growth.
To configure retention:
- Open the InfluxDB web interface.
- Go to "Data" and select "Buckets".
- Click "Settings" next to the relevant bucket.
- Under "Delete data older than", select your preferred retention period.
Data older than the selected retention period will be permanently deleted.
InfluxDB stores data in shards. Shards containing only expired data are deleted automatically. If a shard contains both expired and current data, it remains until all its data has expired. By default, a shard covers 7 days of data. When you set a new retention policy, up to nearly 7 days of outdated data may remain until the next shard cycle. For more details, see the InfluxDB shard documentation.