Hot vs warm vs cold data, and retention policies
coreintermediateNot all data is accessed at the same rate for the same amount of time, and pricing it as if it were wastes money on one end and risks losing it on the other. "Hot" data is read or written constantly and needs to sit on fast, expensive storage — the last few days of orders, the active session table. "Warm" data is accessed occasionally — last quarter's reports, a user's older messages — and can live on cheaper storage with slightly higher latency. "Cold" data is rarely touched but still has to exist — seven-year-old tax records, an old audit log — and belongs on the cheapest, slowest tier, sometimes with a retrieval delay measured in hours. A retention policy is the separate decision of how long each category of data must be kept at all, driven by business need (a customer might dispute a charge from last year) and by law (many financial and healthcare regulations set a specific minimum retention period). A legal hold overrides both temperature and retention: when data becomes relevant to litigation or an investigation, it must be preserved exactly as it is, even past its normal deletion date, until the hold is lifted — deleting held data on schedule despite a hold is not a technical bug, it is a legal one.
Think of it as
Think of a filing system in an office: today's paperwork sits on the desk (hot — instant access, limited desk space), last year's files go in filing cabinets down the hall (warm — a short walk, more capacity), and anything older than that goes to an off-site archive warehouse (cold — a phone call and a wait, but nearly unlimited space at low cost). A retention policy is the office's shredding schedule taped to the wall — "tax records: 7 years, then shred." A legal hold is a manager walking over and saying "stop shredding anything related to the Smith account, no matter what the schedule says" — it suspends the normal schedule for a specific, named subset of files until someone explicitly lifts it.
What we're doing: Read a retention policy table and predict what happens to one record over its lifetime.
- 2
- For its first 30 days the order sits in hot storage because the order-status API needs sub-second reads while a customer might still be checking on it.
- 3
- After 30 days nothing reads it in real time anymore, so it moves to warm storage — cheaper, and a report job reading it once a night does not need millisecond latency.
- 7
- The legal hold is what actually matters for this specific order: even once it ages into the cold tier and even after it crosses the 7-year mark, it must not be deleted while case #LH-2231 is open, because the hold overrides the retention schedule entirely for this record.
Why this works: The tier (hot/warm/cold) and the retention clock (7 years then delete) are two independent axes that most designs get right in isolation — the mistake that actually loses data or creates legal exposure is forgetting that a hold is a third, overriding axis that a scheduled deletion job must check before every delete, not something handled once at write time.
Running scheduled deletion against age alone, without checking hold status
Wrong
Better
What you see: A record under active litigation is deleted by a routine nightly job because the job only ever checked age, and the deletion itself becomes evidence of spoliation in the case it was needed for.
Why: Age-based retention and legal holds are stored and reasoned about separately in most systems — the hold table gets added after the retention job already exists, so it is easy for the join back to the hold table to be left out of the one place (the actual delete statement) where it is safety-critical.
- Hot — fast, expensive — accessed constantly
- Warm — medium cost, occasional reads
- Cold — cheapest, rare reads, minutes-hours retrieval
- Legal hold — freezes deletion for named records regardless of tier
The three temperature tiers, by access pattern and typical cost
Remember: Hot/warm/cold is about access frequency and cost, not about whether data can be deleted. A retention policy is a separate, explicit answer to "how long must this exist," and a legal hold is a third axis that overrides both — deletion jobs must check hold status on every run, not just age.
See also: key management · the object storage model

