Documentation

Database and retention policy mapping

The InfluxDB 1.x data model includes databases and retention policies. InfluxDB Cloud replaces databases and retention policies with buckets. To support InfluxDB 1.x query and write patterns in InfluxDB Cloud, 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.

To query data in InfluxQL that was written using the api/v2/write API, you must manually create a DBRP mapping to map a bucket to a database and retention policy. For more information, see Create DBRP mappings.

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 writing data

When writing data using the /write compatibility endpoint, the DBRP mapping service checks for a bucket mapped to the database and retention policy:

  • If a mapped bucket is found, data is written to the bucket.
  • If an unmapped bucket with a name matching:
    • database/retention policy exists, a DBRP mapping is added to the bucket, and data is written to the bucket.
    • database exists (without a specified retention policy), the default database retention policy is used, a DBRP mapping is added to the bucket, and data is written to the bucket.

When querying data

When querying data from InfluxDB Cloud using the /query compatibility endpoint, the DBRP mapping service checks for the specified database and retention policy (if no retention policy is specified, the database’s default retention policy is used):

  • If a mapped bucket exists, data is queried from the mapped bucket.
  • If no mapped bucket exists, InfluxDB returns an error. See how to Create DBRP mappings.

For more information on the DBRP mapping API, see the /api/v2/dbrps endpoint documentation.

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!


Introducing InfluxDB Clustered

A highly available InfluxDB 3.0 cluster on your own infrastructure.

InfluxDB Clustered is a highly available InfluxDB 3.0 cluster built for high write and query workloads on your own infrastructure.

InfluxDB Clustered is currently in limited availability and is only available to a limited group of InfluxData customers. If interested in being part of the limited access group, please contact the InfluxData Sales team.

Learn more
Contact InfluxData Sales

The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Flux is going into maintenance mode and will not be supported in InfluxDB 3.0. This was a decision based on the broad demand for SQL and the continued growth and adoption of InfluxQL. We are continuing to support Flux for users in 1.x and 2.x so you can continue using it with no changes to your code. If you are interested in transitioning to InfluxDB 3.0 and want to future-proof your code, we suggest using InfluxQL.

For information about the future of Flux, see the following:

InfluxDB Cloud powered by TSM