Apache Kafka / Advanced: atomic processing and recovery design / Lesson 21
Tiered storage and historical read boundaries
Evaluate local and remote log storage for bounded historical reads and recovery evidence.
On this page
Lesson goals
- Distinguish local retention from total retained history.
- Plan and verify a historical read without assuming remote storage is a backup.
Separate local and remote storage
Kafka tiered storage places log data in local and remote tiers under the deployed configuration. Recent reads may be served locally while older retained segments require the remote storage implementation and metadata path. The exact setup depends on the Kafka release and storage manager. The selected 4.1 documentation describes interfaces and configuration; do not assume a production-ready remote storage implementation exists merely because the broker supports the feature.
Distinguish retention windows
The following synthetic plan asks for seven days of total history and assumes one day is local. These numbers are planning requirements, not a working configuration or proof that data exists. Review total retention, local retention, segment movement and the selected implementation together. Compaction, deletion and operational failures can alter what a reader can recover; a local window alone does not define the complete replay contract.
{"topic":"parcel-events","local_window_hours":24,"required_history_hours":168,"note":"planning assumptions, not Kafka configuration"}
The values distinguish a local window from an intended total history without configuring a cluster.
Trace a historical read
For a requested five-day-old record, the local assumption in this fixture is insufficient to decide availability. Check the partition’s retained range, remote segment and metadata availability, authorization and the actual reader behavior. Measure the restored read path in an authorized lab before making latency promises. A record’s age is not by itself an offset, and the oldest available local segment does not prove that older remote data is readable.
{"requested_history_hours":120,"local_window_hours":24,"decision":"inspect remote availability and total retention"}
The fixture prompts a remote-path check; it does not claim a record is available.
Define failure and backup boundaries
A remote tier introduces storage, metadata, network and access dependencies. Identify the owner and response when any one is unavailable, and preserve evidence before altering retention or deleting data. Tiering is not automatically an independent backup: verify failure domains, recovery procedures and the ability to reconstruct required business state separately. A successful tail read cannot establish that a historical replay will work.
Rehearse and reconcile
In a disposable environment with a suitable configured implementation, publish identifiable synthetic records and observe the documented local and remote lifecycle. Read a record beyond the intended local window, then reconcile its identity and payload with the source fixture. Test the failure response without affecting real storage. Record the implementation, versions, retention and actual observations; do not claim that a JSON planning exercise executed a broker or proved production recovery.
Common errors and fixes
The local retention window is treated as the total replay guarantee.
- Why it happens
- The storage tiers and total retention were conflated.
- How to fix it
- Document both windows and verify the remote read path.
- Prevent it next time
- Review replay requirements against observed retained ranges.
A remote tier is assumed to be an independent backup.
- Why it happens
- Storage placement was confused with recovery isolation.
- How to fix it
- Assess failure domains and restore procedures separately.
- Prevent it next time
- Rehearse recovery from the documented source.
An old record is assumed available because its age fits the plan.
- Why it happens
- Actual segment, metadata and authorization evidence was not checked.
- How to fix it
- Inspect the relevant partition and perform an authorized bounded read.
- Prevent it next time
- Monitor the historical path as well as tail consumption.
2 practice exercises
1. The local window is 24 hours and a reader needs a five-day-old event. Is it necessarily available?
Show worked solution
No. Five days exceeds the stated local window, but availability depends on total retention, remote segments, metadata, access and actual cleanup behavior. Inspect the relevant partition and test the authorized read; the planning numbers are not evidence of retained data.
2. A tail consumer reads successfully while a replay fails. What should be compared?
Show worked solution
Compare the requested offset with the retained range and inspect the remote storage and metadata path, credentials and reader error. Tail reads can use a different path from historical segments, so their success does not prove remote recovery works.
Key takeaways
- Local and total retention answer different recovery questions.
- Validate historical reads and independent backup assumptions separately.