Quick revision
The short answer
Tiered storage (KIP-405) keeps recent segments on broker disks and copies closed segments to remote storage, usually object storage, through a RemoteStorageManager plugin. Brokers turn it on with remote.log.storage.system.enable=true plus the plugin settings, and each topic opts in with remote.storage.enable=true. retention.ms still sets how long data exists in total, local.retention.ms sets how long it also stays on local disk, and compacted topics cannot use it.
What to remember
In this answer, we saw that tiered storage copies closed segments to remote storage through a RemoteStorageManager plugin, tracks them with a RemoteLogMetadataManager, and serves old offsets from the remote store without any client change. Brokers enable it with remote.log.storage.system.enable=true and a plugin, topics opt in with remote.storage.enable=true, retention.ms keeps setting total lifetime while local.retention.ms sets the local window, and compacted topics stay local.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Tiered storage (KIP-405) keeps recent segments on broker disks and copies closed segments to remote storage, usually object storage, through a RemoteStorageManager plugin. Brokers turn it on with remote.log.storage.system.enable=true plus the plugin settings, and each topic opts in with remote.storage.enable=true. retention.ms still sets how long data exists in total, local.retention.ms sets how long it also stays on local disk, and compacted topics cannot use it.
Why this question is asked
For years, keeping a month of data in Kafka meant buying a month of local disk, three times over for replication, and waiting hours whenever a broker had to be rebuilt. Tiered storage changes that trade, and it is now a standard part of planning a cluster. Interviewers ask about it to check that we know how it works rather than just its name, because the settings interact in ways that surprise people. In this answer, we will recap how a partition's log is stored, then see how tiering works, how to turn it on at the cluster and topic level, how the two retention settings combine, and which topics have to stay local.
1A Quick Recap of Segments and Retention
A Kafka partition is stored as a series of segment files. Only the newest one, the active segment, receives writes; when it reaches segment.bytes (1 GB by default) or segment.ms, it is closed and a new one starts. Retention works on closed segments: when a whole segment is older than retention.ms or the partition is larger than retention.bytes, the broker deletes that segment.
Without tiering, every segment lives on the local disks of every replica. Seven days of retention on a topic with replication factor 3 means three full copies of seven days of data on broker disks.
2How Tiered Storage Works
With tiered storage, the leader of each partition copies every closed segment, together with its index files, to a remote store. The copy goes through a RemoteStorageManager, a plugin interface; Apache Kafka defines the interface, and an implementation for S3, GCS or Azure Blob comes from a separate open-source or vendor plugin. Information about which segments are remote, and their offsets, is kept by a RemoteLogMetadataManager. The default implementation stores that metadata in an internal topic, __remote_log_metadata, so every broker can find remote segments.
Once a segment is safely uploaded, local copies can be deleted earlier than total retention allows. When a consumer asks for an offset that is no longer on local disk, the broker reads it from the remote store and returns it like any other fetch. Clients need no change at all.
- Active segment receives writesLocal only; never uploaded while active
- Segment closes
segment.bytesorsegment.msreached - Leader uploads segment and indexesThrough the
RemoteStorageManagerplugin - Metadata recorded
RemoteLogMetadataManager, by default the __remote_log_metadata topic - Older than local.retention.ms?YesDelete local copies, serve from remoteNoKeep serving from local disk
- Older than retention.ms?YesDelete from remote storage tooNoKeep in remote storage
6 steps in order. Play them, or step through them one at a time.
3Turning It On: Cluster and Topic
Tiering is enabled in two places. The brokers must enable the remote log subsystem and be told which plugins to load, and each topic must opt in.
Tiered storage was added as early access in 3.6 and declared production ready in a later 3.x release (3.9), so check your version's notes. Some operations also changed over time; for example, turning tiering off again for a topic was only supported from a later release, so check before relying on it.
4How retention.ms and local.retention.ms Work Together
The key idea is that retention.ms and retention.bytes keep their old meaning: how long data exists at all. local.retention.ms and local.retention.bytes are new and only say how long a copy also stays on broker disks. The local value must be no larger than the total. Its default is -2, which means 'use the total retention', so if we forget to set it, nothing is deleted locally earlier and we save no disk.
| Age of data | On broker disks | In remote storage | Read from |
|---|---|---|---|
| Active segment | Yes | No | Page cache or local disk |
| Closed, under 1 day | Yes | Yes, once uploaded | Local disk |
| 1 to 90 days | No | Yes | Remote storage |
| Over 90 days | No | No, deleted | Not available |
Notice that a segment is deleted locally only after it has been uploaded. If uploads fall behind, segments stay local beyond local.retention.ms, which protects data but can fill disks. The same rule applies to size: local.retention.bytes caps local size per partition, and retention.bytes still caps the total.
5Which Topics Cannot Use It
Compacted topics, those with cleanup.policy=compact, are not supported. Compaction rewrites old segments to keep only the latest value per key, which does not fit the model of immutable segments copied once to remote storage. So changelog topics of Kafka Streams, the __consumer_offsets topic and reference-data topics stay on local storage. Kafka's own internal topics are never tiered.
In practice that is fine, because compacted topics are usually small. The big topics, event streams with time-based deletion, are exactly where tiering pays off.
6Follow-up questions
Does tiered storage reduce the number of replicas?
Only for the remote part. Locally, a partition still has its replication factor, say three copies, for the local retention window. Remote storage holds a single copy of each segment uploaded by the leader, and the object store provides its own durability, for example by replicating across zones internally.
Are reads from remote storage as fast as local reads?
No. Recent data is served from the page cache in milliseconds, while remote reads pay the object store's first-byte latency on each request, often tens to hundreds of milliseconds. Tiered storage is meant for cheap long retention and occasional replay, not for latency-sensitive reads of old data.
What happens to a low-traffic partition whose active segment never fills?
It is never uploaded until it closes. If segment.ms is seven days and traffic is low, a week of data stays local regardless of local.retention.ms. On tiered topics with low volume, lowering segment.ms (for example to a few hours) lets segments roll and upload sooner.
7Conclusion
In this answer, we saw that tiered storage copies closed segments to remote storage through a RemoteStorageManager plugin, tracks them with a RemoteLogMetadataManager, and serves old offsets from the remote store without any client change. Brokers enable it with remote.log.storage.system.enable=true and a plugin, topics opt in with remote.storage.enable=true, retention.ms keeps setting total lifetime while local.retention.ms sets the local window, and compacted topics stay local.
Open with
Tiered storage, from KIP-405, splits a partition's log into a local tier and a remote tier. Recent segments stay on broker disks as usual, and once a segment is closed, the leader uploads it with its indexes to remote storage, usually an object store like S3.
Then, if they want more
The upload goes through a RemoteStorageManager plugin, which Kafka defines as an interface; the actual S3 or GCS implementation comes from a plugin. The metadata about which segments are remote is kept by a RemoteLogMetadataManager, by default in an internal topic.
It was early access in 3.6 and became production ready in a later 3.x release, so I would check the exact version. To turn it on, every broker sets remote.log.storage.system.enable=true plus the plugin class and its settings, and each topic opts in with remote.storage.enable=true.
For retention, retention.ms and retention.bytes still mean the total lifetime of the data. local.retention.ms and local.retention.bytes say how long a copy also stays on local disk. So 90 days total with one day local means consumers near the head read locally and anything older comes from remote storage.
The local default is to follow the total, so you have to set it to save disk, and nothing is deleted locally until it has been uploaded. The active segment is never uploaded, so segment rolling matters too. Compacted topics are not supported, so changelogs and reference data stay local.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Apache Kafka documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "What is Kafka tiered storage, which settings turn it on for a cluster and for a topic...": https://scrivio-interview-library.netlify.app/spring-boot/kafka-internals/32329d1f28/