This section contains instructions for configuring the Storage Integration on Enterprise distributions.
Note:The Storage Integration is already configured on Cloud and Community Edition distributions. To enable and use the integration for specific Applications, follow the instructions in the Enable and Retrieve sections.
The Storage Integration requires configuration for the underlying storage provider used, along with a few options for tuning performance and memory usage.
You can configure PostgreSQL, or any other PostgreSQL-compatible database (e.g. TimescaleDB). A base-line configuration can be found below. Add the following section into your existing
ttn-lw-stack.yml configuration file. See Storage Integration Options for more details.
Note:This will use the same database instance that is used for the Identity Server as well. In production deployments, this should be a different database.
The Storage Integration has special configuration options for TimescaleDB. These options are set as flags when the database is initialized.
This configures the chunk time interval. It accepts values in hours, and is set to
168 hours by default.
This enables or disables the retention policy for TimescaleDB. If enabled, data older than the retention-days will be deleted.
Note:This configuration option will have immediate effect and delete messages older than the retention value.
This sets the number of days for the retention policy. It accepts values in days, and is set to
30 days by default.
Initialize the configured database with:
$ ttn-lw-stack storage-db init
If you are using TimescaleDB, the following configuration options are also available:
--timescaledb.chunk-time-interval --timescaledb.enable-retention-policy --timescaledb.retention-days
If you are using Docker Compose (as shown in the Getting Started guide), you should instead do:
$ docker-compose run --rm stack storage-db init
If everything went well, upon restart, you should be able to see the following log message:
INFO Initialized Storage Integration namespace=applicationserver/io/packages/storage provider=postgres