Interview's MateData Engineer
Interview's Mate

Data Engineer

SQL · Spark · Lakehouse · Streaming

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Data Engineer topics
Lesson 59/ 160
03. Data Warehousing & Data Modeling

Data Archival, Retention Policies & Cold Storage Tiering

Apply retention policies and move cold data to cheaper tiers without breaking compliance or restores.

IntermediateRetention · Archival · Tiering3 quiz questions
Practice Generative AI Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

Regulation, source, consumer, and active horizon. Next, tier or delete by policy event. Finally, periodic restore, cost, and chain of custody.

Think of it like…

Archival is a labeled, indexed off-site warehouse: cheaper per box, but retrieval takes planned effort, and a legal hold overrides the usual destruction schedule.

Where you’ve seen it

A 90-day raw partition moves from S3 Standard to Glacier Instant Retrieval after warehouse compaction; a consent delete fans out by user ID, while legal-hold objects are explicitly excluded from lifecycle deletion.

Words you’ll hear

Retention
Rules defining minimum/maximum storage duration, deletion triggers, exceptions, and evidence.
Archival
Moving intact data plus metadata to lower-cost storage while preserving integrity and a known restore/query path.
Tiering
Storage classes optimized for low access frequency and retrieval latency/cost trade-offs rather than interactive table serving.
Operational boundary
Lifecycle rules that transition small active files cause restore delays or surprise retrieval fees, while deleting one system's PII does not purge it from logs, backups, exports, and downstream lake copies. Create data-class retention contracts, propagate deletion events with evidence, choose archival formats and query boundaries explicitly, test restores, and route immutable compliance copies to separate encrypted storage.

Visual diagram

Loading interactive diagram

Theory & deep dive

Retention: the working mechanism

Retention classifies data by legal and operational need, archival moves infrequently read data to lower-cost durable tiers, and deletion/restore procedures prove that expiry and recovery still work.

Regulation, source, consumer, and active horizon. Tier or delete by policy event, then lineage-aware deletion and legal holds; this exposes the state governed by Tiering.

Data Archival, Retention Policies & Cold Storage Tiering in one concrete design

A 90-day raw partition moves from S3 Standard to Glacier Instant Retrieval after warehouse compaction; a consent delete fans out by user ID, while legal-hold objects are explicitly excluded from lifecycle deletion.

Key takeaway: Retention classifies data by legal and operational need, archival moves infrequently read data to lower-cost durable tiers, and deletion/restore procedures prove that expiry and recovery still work

Data Archival, Retention Policies & Cold Storage Tiering: failure mode and production response

Lifecycle rules that transition small active files cause restore delays or surprise retrieval fees, while deleting one system's PII does not purge it from logs, backups, exports, and downstream lake copies.

Create data-class retention contracts, propagate deletion events with evidence, choose archival formats and query boundaries explicitly, test restores, and route immutable compliance copies to separate encrypted storage. Track Retention age as "days from a policy event, not just file mtime", and make Restore SLA visible to the dataset owner.

Key takeaway: Create data-class retention contracts, propagate deletion events with evidence, choose archival formats and query boundaries explicitly, test restores, and route immutable compliance copies to separate encrypted storage.

How it works, step by step

Step 1 of 4
Retention

1. Classify

Regulation, source, consumer, and active horizon. Retention classifies data by legal and operational need, archival moves infrequently read data to lower-cost durable tiers, and deletion/restore procedures prove that expiry and recovery still work.

regulation, source, consumer, and active horizon
Key numbers at this step
Retention age
days from a policy event, not just file mtime
Archival
Moving intact data plus metadata to lower-cost storage while preserving integrity and a known restore/query path.

When to use it & trade-offs

What it is

Retention classifies data by legal and operational need, archival moves infrequently read data to lower-cost durable tiers, and deletion/restore procedures prove that expiry and recovery still work. A 90-day raw partition moves from S3 Standard to Glacier Instant Retrieval after warehouse compaction; a consent delete fans out by user ID, while legal-hold objects are explicitly excluded from lifecycle deletion.

Why it matters: Lifecycle rules that transition small active files cause restore delays or surprise retrieval fees, while deleting one system's PII does not purge it from logs, backups, exports, and downstream lake copies. Create data-class retention contracts, propagate deletion events with evidence, choose archival formats and query boundaries explicitly, test restores, and route immutable compliance copies to separate encrypted storage.

When to reach for it

  • Apply retention policies and move cold data to cheaper tiers without breaking compliance or restores.
  • Choose Retention because it provides this capability: Rules defining minimum/maximum storage duration, deletion triggers, exceptions, and evidence.
  • Keep evidence for Retention age at "days from a policy event, not just file mtime" so the last production stage-Prove recovery - periodic restore, cost, and chain of custody-remains testable.

When to avoid or be careful

  • Lifecycle rules that transition small active files cause restore delays or surprise retrieval fees, while deleting one system's PII does not purge it from logs, backups, exports, and downstream lake copies.
  • Do not conflate Archival with Retention. The second concept contributes different behavior: Moving intact data plus metadata to lower-cost storage while preserving integrity and a known restore/query path.
  • Release only after this guardrail is in place: Create data-class retention contracts, propagate deletion events with evidence, choose archival formats and query boundaries explicitly, test restores, and route immutable compliance copies to separate encrypted storage.

Retention / Archival / Tiering - roles, limits, and operating cost

Retention
Best for: Rules defining minimum/maximum storage duration, deletion triggers, exceptions, and evidence.

Strengths: Rules defining minimum/maximum storage duration, deletion triggers, exceptions, and evidence. Retention classifies data by legal and operational need, archival moves infrequently read data to lower-cost durable tiers, and deletion/restore procedures prove that expiry and recovery still work.

Watch out: Lifecycle rules that transition small active files cause restore delays or surprise retrieval fees, while deleting one system's PII does not purge it from logs, backups, exports, and downstream lake copies.

Archival
Best for: Moving intact data plus metadata to lower-cost storage while preserving integrity and a known restore/query path.

Strengths: Moving intact data plus metadata to lower-cost storage while preserving integrity and a known restore/query path. In this workflow it supports: Propagate - lineage-aware deletion and legal holds.

Watch out: The operating cost is real: minutes, hours, or days required for archived access.

Tiering
Best for: Storage classes optimized for low access frequency and retrieval latency/cost trade-offs rather than interactive table serving.

Strengths: Storage classes optimized for low access frequency and retrieval latency/cost trade-offs rather than interactive table serving. Its output can be checked with Deletion coverage.

Watch out: Operating guardrail: Create data-class retention contracts, propagate deletion events with evidence, choose archival formats and query boundaries explicitly, test restores, and route immutable compliance copies to separate encrypted storage.

Interview signals & numbers to know

When this topic comes up

  • “Where is the failure boundary for Retention, and how would Retention age reveal it?”
  • “Why is Archival distinct from this behavior: storage classes optimized for low access frequency and retrieval latency/cost trade-offs rather than interactive table serving?”
  • Production clue: Lifecycle rules that transition small active files cause restore delays or surprise retrieval fees, while deleting one system's PII does not purge it from logs, backups, exports, and downstream lake copies.
  • Design probe: Create data-class retention contracts, propagate deletion events with evidence, choose archival formats and query boundaries explicitly, test restores, and route immutable compliance copies to separate encrypted storage.

Benchmarks & rules of thumb

Retention age -
days from a policy event, not just file mtime
Restore SLA -
minutes, hours, or days required for archived access
Deletion coverage -
all raw, curated, cache, export, and backup copies accounted for

Common mistakes & follow-ups

Common interview mistakes

  • Lifecycle rules that transition small active files cause restore delays or surprise retrieval fees, while deleting one system's PII does not purge it from logs, backups, exports, and downstream lake copies.
  • Reporting success from a job exit code without checking Retention age and Restore SLA.
  • Treating this example as complete without replay, rollback, or access boundaries: A 90-day raw partition moves from S3 Standard to Glacier Instant Retrieval after warehouse compaction; a consent delete fans out by user ID, while legal-hold objects are explicitly excluded from lifecycle deletion.

Likely interviewer follow-ups

  • How would you prove this contract instead of only checking that the command ran: Rules defining minimum/maximum storage duration, deletion triggers, exceptions, and evidence.
  • What does the recovery plan do when this occurs? Lifecycle rules that transition small active files cause restore delays or surprise retrieval fees, while deleting one system's PII does not purge it from logs, backups, exports, and downstream lake copies.
  • When is Retention insufficient for Restore SLA, and what does adding Archival cost in Retention age?
Interview tip: Lead with the data path and failure boundary: Retention classifies data by legal and operational need, archival moves infrequently read data to lower-cost durable tiers, and deletion/restore procedures prove that expiry and recovery still work. Then make the answer operational: Create data-class retention contracts, propagate deletion events with evidence, choose archival formats and query boundaries explicitly, test restores, and route immutable compliance copies to separate encrypted storage.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Data Archival, Retention Policies & Cold Storage Tiering with data engineer interview Q&A and hands-on practice.

Open Data Engineer Q&A →Machine Learning Q&A
Previous topic
Handling Late-Arriving Facts & Late-Arriving Dimensions
Next topic
Warehouse Cost Optimization & Query FinOps