Apache Kafka Tiered Storage and Remote Logs Explained
Apache Kafka tiered storage lets a cluster keep recently used log segments on broker disks while storing older segments in a remote system. Kafka operators and data engineers use it to extend retention without adding broker-local disks for every retained byte. It changes where Kafka stores partition data and how older reads are served, but it does not change the topic or consumer API.
Why Kafka Tiered Storage Is Being Talked About
Kafka is often used as both a real-time event stream and a replayable log. Keeping a longer history on broker disks can force teams to add brokers primarily for storage, even when they do not need more CPU or network capacity. Those extra brokers also increase cluster operations and the amount of local data that must be copied when partitions move or a broker is replaced.
The Apache Kafka project describes Kafka as a distributed event-streaming platform with durable storage. Tiered storage separates the storage needs of recent traffic from the longer retention window. Kafka’s KIP-405 design was marked production-ready beginning with Kafka 3.9. The feature is still opt-in and requires a remote storage implementation; it is not an automatic switch that sends every topic to object storage.
What Is Apache Kafka Tiered Storage?
Kafka tiered storage is a two-level arrangement for a topic’s log segments:
- The local tier uses broker storage for the recent part of each partition log. It is well suited to the common case of consumers reading near the end of the stream.
- The remote tier stores completed segments in an external storage system, such as an object store or distributed filesystem, for longer retention and older reads.
The partition log remains the logical data model. Producers still write to Kafka brokers, consumers still request records through Kafka’s protocol, and offsets still identify positions within a partition. A consumer does not need to know whether a requested segment is on local disk or in remote storage.
Kafka’s tiered-storage documentation explains the broker and topic settings. The broker must have a compatible RemoteStorageManager implementation, and each eligible topic must opt in with remote.storage.enable. Kafka provides remote-log metadata management, but does not ship a general-purpose remote storage manager implementation.
The Problem Tiered Storage Solves
Without tiers, a Kafka cluster typically retains its log segments on broker disks until the topic’s time- or size-based retention policy removes them. Extending retention therefore increases local capacity requirements. Adding brokers can provide more disks, but it also adds memory, CPU, network connections, and maintenance overhead whether or not those resources are otherwise needed.
Long local logs can also increase the work involved in broker recovery and partition rebalancing: replicas may need to copy more bytes across the cluster. Reducing the local retention window can reduce that local footprint, while retaining older segments remotely for replay or backfill. The trade-off is that remote storage has its own cost, performance, availability, and operational requirements.
Tiered storage does not make Kafka a backup system or eliminate separate data pipelines. It makes older Kafka log segments available through the same topic interface, subject to the configured remote retention and provider behavior. It also does not replace table formats, archives, or transformation pipelines when consumers need those systems’ semantics.
How Remote Logs Work
Kafka writes records into partition log segments on brokers. The active segment is still being written; once a segment rolls and is eligible for offload, Kafka’s remote log manager coordinates its copy and tracks the segment’s remote location and offset range. Related index and auxiliary files are also needed to locate and interpret the records.
After Kafka confirms the remote copy, the local segment can become eligible for deletion according to the topic’s local retention limits. The overall retention policy governs how long data remains available across the tiers. Local retention is therefore not a timer that deletes a segment before it has been copied successfully.
Recent reads are commonly served from the local tier and can benefit from broker page cache. A read that reaches older offsets may require a remote fetch and can have different latency and throughput. Kafka keeps remote segment metadata separately from segment bytes: the storage manager handles segment lifecycle and reads, while the metadata manager records which remote segments exist and their offset ranges. This separation is important because locating data reliably should not depend on repeatedly listing a large object store.
| Concern | Local tier | Remote tier |
|---|---|---|
| Main role | Serve recent records and active partition work | Retain older, completed log segments |
| Storage location | Broker-managed local disks | External system accessed by a configured provider |
| Typical access pattern | Frequent tail reads | Older replay, backfill, and recovery reads |
| Scaling pressure | Shares broker capacity and local disk | Can scale storage separately from broker-local capacity |
| Read behavior | Usually lower latency; may use page cache | Depends on remote service, network, and provider |
| Retention control | local.retention.ms and local.retention.bytes |
Overall retention.ms and retention.bytes |
| Operational dependency | Healthy Kafka brokers and local disks | Kafka plus remote service, metadata, credentials, and network |
These are relative tendencies, not performance guarantees. A frequently replayed historical range can create sustained remote reads, and remote storage charges can include requests and transfer as well as bytes stored.
Key Components and Configuration Concepts
- RemoteLogManager (RLM): Kafka’s internal coordination layer for uploading, reading, and deleting remote log segments as partition state changes.
- RemoteStorageManager (RSM): A pluggable implementation that stores and retrieves segment data and associated files. Choose a provider compatible with the Kafka release and configure its class and class path on brokers.
- RemoteLogMetadataManager (RLMM): Tracks remote segment metadata, including the partition and offset information needed to serve reads. Kafka’s default implementation uses an internal topic.
- Topic retention settings:
local.retention.msandlocal.retention.byteslimit the local tier.retention.msandretention.byteslimit the total retained log. If local values are not set, Kafka can use the overall limits for local retention as described in its documentation. - Index cache: Brokers maintain local cached metadata/index files for remote segments to avoid fetching them repeatedly. Cache sizing and remote fetch behavior should be monitored along with provider metrics.
The remote tier does not make all data instantly available locally after a broker failure. The Kafka cluster, remote storage, credentials, network path, and remote-segment metadata must all work for older reads to succeed. A design should budget for restoring access, not only for storage capacity.
Real-World Uses
Tiered storage can help an event platform retain an audit or telemetry stream longer without increasing broker-local capacity at the same rate. It can also extend the replay window for consumers that rebuild derived data after an outage or reprocess historical events for a new application.
It is most useful when recent events are read frequently but older segments are queried less often. If nearly all retained data is read frequently, remote access may increase latency and transfer costs without providing much benefit. If only a small subset of records needs long-term retention, a separate sink or archive may be more appropriate than retaining the entire Kafka log remotely.
Recovery is another design consideration. Smaller local logs may reduce broker-to-broker copying during reassignment, but a consumer recovering from an old offset now depends on remote reads. Test the actual replay and restore patterns, including the time to read data after a broker restart or remote-service interruption.
Practical Guide: Enable It Carefully
The following illustrates the two configuration layers. It is not a complete production configuration: replace the example manager class, class path, listener, retention values, and security settings with those supported by the selected provider and Kafka version.
On each broker, enable the feature and configure a compatible remote storage manager. Kafka’s default metadata manager uses an internal topic; when using it, configure the listener its clients should use:
remote.log.storage.system.enable=true
remote.log.storage.manager.class.name=com.example.kafka.storage.RemoteStorageManager
remote.log.storage.manager.class.path=/opt/kafka/plugins/remote-storage-provider.jar
remote.log.metadata.manager.listener.name=INTERNAL
After the brokers are prepared, create a topic with remote storage enabled and distinct local and total retention windows:
bin/kafka-topics.sh --create \
--topic orders.events \
--bootstrap-server kafka-1.example.net:9092 \
--partitions 12 \
--replication-factor 3 \
--config remote.storage.enable=true \
--config local.retention.ms=259200000 \
--config retention.ms=604800000
This example requests three days of local retention and seven days overall. It does not configure a provider or guarantee that a segment has already been uploaded. A closed segment must be eligible for copy and successfully stored before Kafka can remove its local copy. Select a partition count and replication factor based on the workload and cluster rather than copying the example values.
Inspect the effective topic configuration and partition placement:
bin/kafka-configs.sh --bootstrap-server kafka-1.example.net:9092 \
--describe --entity-type topics --entity-name orders.events
bin/kafka-topics.sh --bootstrap-server kafka-1.example.net:9092 \
--describe --topic orders.events
Then verify the provider’s upload and read metrics, broker logs, remote-log metadata health, and remote storage lifecycle. Test a consumer read that starts at an older offset and compare its completion time with the service objective. Use a non-production topic and provider test environment first. Kafka’s tiered storage operations guide includes a local test implementation and a complete test workflow, but that test fixture is not a production remote storage backend.
Before rollout, confirm the provider’s authentication, encryption, retry, throttling, retention, and deletion behavior. Check how a topic deletion or a feature disable operation affects remote segments. Kafka’s tiered-storage GA release notes document compatibility and operational limitations that should be reviewed for the deployed version.
Common Misconceptions
“Kafka moves every record to remote storage as soon as it is written.”
Kafka uploads eligible completed segments, not the actively written segment. Segment rolling and remote-copy progress affect when data becomes available in the remote tier and when local copies can be removed.
“Remote storage is transparent, so old reads cost the same as tail reads.”
Kafka clients use the same topic and offset model, but the physical read path is different. Network transfer, remote service performance, fetch limits, index access, and provider throttling can change latency and throughput. Measure backfills and consumer recovery against the expected workload.
“Tiered storage is a backup or works for every topic.”
Remote segments extend Kafka’s log retention; they do not provide independent protection from all operator errors, compromised credentials, or incorrect retention configuration. The current Kafka documentation also lists unsupported cases, including compacted topics. Review release-specific limitations, retain separate backups where required, and test recovery rather than assuming an extra storage tier is a backup.
“The Kafka project includes a ready-made S3 implementation.”
Kafka defines the RemoteStorageManager extension point, but its official documentation states that a remote storage implementation must be supplied and configured. A provider’s compatibility, support policy, and failure semantics are part of the system design.
Related Articles
- Start with the Apache Kafka event streaming guide for topics, partitions, replication, and retention.
- Learn how Kafka consumer groups and partition rebalancing manage readers that replay retained records.
- See how Kafka transactions and exactly-once processing coordinate Kafka reads and writes.
- Distinguish application log storage from Apache Kafka KRaft metadata quorums, which replicate cluster metadata rather than topic records.
Changelog and Last Updated
- Changelog: Initial publication.
- Last updated: Reviewed against Apache Kafka’s tiered storage documentation, KIP-405, and GA release notes.

