Documentation

Database and retention policy mapping

The InfluxDB 1.x data model includes databases and retention policies. InfluxDB 2.6 replaces databases and retention policies with buckets. To support InfluxDB 1.x query and write patterns in InfluxDB 2.6 , databases and retention policies are mapped to buckets using the database and retention policy (DBRP) mapping service.

The DBRP mapping service uses the database and retention policy specified in 1.x compatibility API requests to route operations to a bucket.

Default retention policies

A database can have multiple retention policies with one set as default. If no retention policy is specified in a query or write request, InfluxDB uses the default retention policy for the specified database. Use the influx CLI or the InfluxDB API to set a retention policy as the default retention policy for a database.

When creating a bucket

When you create a bucket, InfluxDB 2.6 automatically creates a “virtual” DBRP mapping. Virtual DBRP mappings are those that are created on your behalf.

  • If your bucket name includes a forward slash (/), the virtual DBRP mapping uses everything before the forward slash as the database name and everything after the forward slash as the retention policy name. If the database does not already have a default retention policy, the parsed retention policy is set as the default.
  • If your bucket name does not include a forward slash (/), the virtual DBRP mapping uses the bucket name as the database and autogen as the retention policy. The autogen retention policy is set as the default retention policy.

When writing data

When writing data using the /write compatibility endpoint, the DBRP mapping service uses the database and retention policy specified in the request to write the data to the appropriate bucket.

When querying data

When querying data from InfluxDB 2.6

using the /query compatibility endpoint, the DBRP mapping service uses the database and retention policy specified in the request to query data from the appropriate bucket. If no retention policy is specified, the database’s default retention policy is used.

A DBRP combination can only be mapped to a single bucket

Each unique DBRP combination can only be mapped to a single bucket. If you map a DBRP combination that is already mapped to another bucket, it will overwrite the existing DBRP mapping.


Was this page helpful?

Thank you for your feedback!


Set your InfluxDB URL

Linux Package Signing Key Rotation

All signed InfluxData Linux packages have been resigned with an updated key. If using Linux, you may need to update your package configuration to continue to download and verify InfluxData software packages.

For more information, see the Linux Package Signing Key Rotation blog post.

InfluxDB Cloud backed by InfluxDB IOx

All InfluxDB Cloud organizations created on or after January 31, 2023 are backed by the new InfluxDB IOx storage engine. Check the right column of your InfluxDB Cloud organization homepage to see which InfluxDB storage engine you’re using.

If powered by IOx, this is the correct documentation.

If powered by TSM, see the TSM-based InfluxDB Cloud documentation.

InfluxDB Cloud backed by InfluxDB TSM

All InfluxDB Cloud organizations created on or after January 31, 2023 are backed by the new InfluxDB IOx storage engine which enables nearly unlimited series cardinality and SQL query support. Check the right column of your InfluxDB Cloud organization homepage to see which InfluxDB storage engine you’re using.

If powered by TSM, this is the correct documentation.

If powered by IOx, see the IOx-based InfluxDB Cloud documentation.

State of the InfluxDB Cloud (IOx) documentation

The new documentation for InfluxDB Cloud backed by InfluxDB IOx is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.