Enable tiered storage for Aiven for Apache Kafka®
Tiered storage significantly improves the storage efficiency of your Aiven for Apache Kafka® service.
Prerequisites
- Access to an Aiven organization and at least one project.
- Aiven for Apache Kafka® service with Apache Kafka version 3.6 or later. Upgrade to the latest default version and apply maintenance updates for the latest fixes and improvements when using tiered storage.
- Aiven CLI.
Review the trade-offs and limitations of tiered storage before enabling it.
Steps to enable tiered storage
- Console
- CLI
- Log in to the Aiven console, and select your project.
- Create an Aiven for Apache Kafka service or select an
existing one.
-
For a new service:
- On the Create Apache Kafka® service page, scroll down to the Tiered storage section.
- Click Enable tiered storage.
- View the pricing for tiered storage in the Service summary.
-
For an existing service:
- Go to the service's Overview page and click Service settings from the sidebar.
- In the Service plan section, click Enable tiered storage to activate it.
- Click Activate tiered storage in the confirmation window.
-
After activating tiered storage for your service and configuring it for your topics, you can monitor usage and costs in the Tiered storage overview section.
Alternatively, if tiered storage is not yet active for your service, you can enable it by selecting Tiered storage from the sidebar.
Enable tiered storage for your Aiven for Apache Kafka service using the Aiven CLI:
-
Retrieve the project information with:
avn project details
For a specific project, use:
avn project details --project <PROJECT_NAME>
-
Find the name of the Aiven for Apache Kafka service for enabling tiered storage with:
avn service list
Make a note of the
SERVICE_NAME
corresponding to your Aiven for Apache Kafka service. -
Enable tiered storage with:
avn service update \
--project demo-kafka-project \
demo-kafka-service \
-c tiered_storage.enabled=true
In this command:
--project demo-kafka-project
: Replacedemo-kafka-project
with your project name.demo-kafka-service
: Specify the Aiven for Apache Kafka service you intend to update.-c tiered_storage.enabled=true
: Activates tiered storage.
Configure default retention policies at service-level
To manage data retention, set default policies for tiered storage at the service level.
- Access Aiven console, select your project, and choose your Aiven for Apache Kafka service.
- Click Service settings from the sidebar.
- Scroll to the Advanced configuration section, and click Configure.
- In the Advanced configuration dialog, click Add Advanced Configuration.
- Define the retention policy:
- Find
kafka.log_local_retention_ms
and set the value to define the retention period in milliseconds for time-based retention. - Find
kafka.log_local_retention_bytes
and set the value to define the retention limit in bytes for size-based retention.
- Find
- Click Save configuration to apply your changes.
You can also configure the retention policies from the Tiered storage overview page.
Optional: Configure client-side parameter
For optimal performance and reduced risk of broker interruptions when
using tiered storage, it is recommended to update the client-side
parameter fetch.max.wait.ms
from its default value of 500 ms to 5000 ms.
This consumer configuration is no longer necessary starting from Apache Kafka version 3.6.2. Consider upgrading to Apache Kafka version 3.6.2 or later before enabling tiered storage.