Retention policy

Retention Policy (RP) specifies how much data should be available at any given time.

It is defined as follows:

  • Duration: This is the time for how long InfluxDB keeps data
  • Replication factor: This is the number of copies of the data that are stored in the cluster
  • Shard group duration: This is the time range that is covered by shard groups
  • Shard groups: This is the logical container for shards and shards contains actual data

If RP is not defined when we create the database, the default autogen RP will be applied.

Autogen has an infinity duration, where the replication factor is 1 and the shard group duration is 7. When RP duration is more than 6 months, InfluxDB will set the shard Group duration to 7 days by default.

Get Seven NoSQL Databases in a Week now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.