Manage databases
An InfluxDB database is a named location where time series data is stored. Each InfluxDB database has a retention period.
If coming from InfluxDB v1, the concepts of databases and retention policies have been combined into a single concept–database. Retention policies are no longer part of the InfluxDB data model. However, InfluxDB Cloud Dedicated does support InfluxQL, which requires databases and retention policies. See InfluxQL DBRP naming convention.
If coming from InfluxDB v2, InfluxDB Cloud (TSM), or InfluxDB Cloud Serverless, database and bucket are synonymous.
Retention periods
A database retention period is the maximum age of data stored in the database. The age of data is determined by the timestamp associated with each point. When a point’s timestamp is beyond the retention period (relative to now), the point is marked for deletion and is removed from the database the next time the retention enforcement service runs.
The minimum retention period for and InfluxDB database is 1 hour. The maximum retention period is infinite meaning data does not expire and will never be removed by the retention enforcement service.
Table and column limits
You can customize table (measurement) limits and table column limits when you create or update a database in InfluxDB Cloud Dedicated.
Table limit
Default maximum number of tables: 500
Each measurement is represented by a table in a database. Your database’s table limit can be raised beyond the default limit of 500. InfluxData has production examples of clusters with 20,000+ active tables across multiple databases.
Increasing your table limit affects your InfluxDB Cloud Dedicated cluster in the following ways:
Column limit
Default maximum number of columns: 250
Configurable maximum number of columns: 1000
Each row must include a time column, with the remaining columns representing tags and fields. As a result, a table with 250 columns can have one time column and up to 249 field and tag columns.
If you attempt to write to a table and exceed the column limit, the write request fails and InfluxDB returns an error.
If you update the column limit for a database, the limit applies to newly created tables; doesn’t override the column limit for existing tables.
Increasing your column limit affects your InfluxDB Cloud Dedicated cluster in the following ways:
Create a database
Use the influxctl database create
command or the Management HTTP API to create a new InfluxDB database in your InfluxDB Cloud Dedicated cluster. Provide a database name and an optional retention period.
CLI
influxctl database create \
--retention-period 30d \
--max-tables 500 \
--max-columns 250 \
DATABASE_NAME
API
curl \
--location "https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases" \
--request POST \
--header "Accept: application/json" \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer MANAGEMENT_TOKEN" \
--data '{
"name": "'DATABASE_NAME'",
"maxTables": 500,
"maxColumnsPerTable": 250,
"retentionPeriod": 2592000000000,
"partitionTemplate": [
{
"type": "tag",
"value": "TAG_KEY_1"
},
{
"type": "tag",
"value": "TAG_KEY_2"
},
{
"type": "bucket",
"value": {
"tagName": "TAG_KEY_3",
"numberOfBuckets": 100
}
},
{
"type": "bucket",
"value": {
"tagName": "TAG_KEY_4",
"numberOfBuckets": 300
}
},
{
"type": "time",
"value": "%Y-%m-%d"
}
]
}'
Update a database
Use the influxctl database update
command or the Management HTTP API to update attributes for a database in your InfluxDB Cloud Dedicated cluster. Provide the database name and the attributes to update.
CLI
influxctl database update \
--retention-period 30d \
--max-tables 500 \
--max-columns 250 \
DATABASE_NAME
API
curl \
--location "https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases/DATABASE_NAME" \
--request PATCH \
--header "Accept: application/json" \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer MANAGEMENT_TOKEN" \
--data '{
"maxTables": 500,
"maxColumnsPerTable": 250,
"retentionPeriod": 2592000000000000
}'
List databases
Use the influxctl database list
command to list databases in your InfluxDB Cloud Dedicated cluster.
CLI
influxctl database list
API
curl \
--location "https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases" \
--header "Accept: application/json" \
--header "Authorization: Bearer MANAGEMENT_TOKEN"
Delete a database
Use the influxctl database delete
command or the Management HTTP API to delete a database from your InfluxDB Cloud Dedicated cluster. Provide the name of the database you want to delete.
CLI
influxctl database delete <DATABASE_NAME>
API
curl \
--location "https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases/DATABASE_NAME" \
--request DELETE \
--header "Accept: application/json" \
--header "Authorization: Bearer MANAGEMENT_TOKEN"
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.