Storage tiers (Hot, Cool, Archive) in Azure - Time & Space Complexity
We want to understand how the time to access or move data changes when using different storage tiers in Azure.
Specifically, how does the number of operations or delays grow when working with Hot, Cool, or Archive storage?
Analyze the time complexity of accessing blobs stored in different tiers.
// Access blobs from different tiers
var hotBlob = container.GetBlobClient("hotBlob");
var coolBlob = container.GetBlobClient("coolBlob");
var archiveBlob = container.GetBlobClient("archiveBlob");
// Read data
var hotData = await hotBlob.DownloadAsync();
var coolData = await coolBlob.DownloadAsync();
// Rehydrate archive blob before reading
await archiveBlob.SetAccessTierAsync(AccessTier.Hot);
// Wait for rehydration to complete before downloading
var archiveData = await archiveBlob.DownloadAsync();
This sequence reads data from blobs in Hot, Cool, and Archive tiers, including rehydration for Archive.
Identify the API calls, resource provisioning, data transfers that repeat.
- Primary operation: Downloading blob data from storage tiers.
- How many times: Once per blob tier (Hot, Cool, Archive).
- Additional operation: Archive blob requires a rehydration API call before download.
As the number of blobs increases, the number of download and rehydration calls grows linearly.
| Input Size (n blobs) | Approx. API Calls/Operations |
|---|---|
| 10 | ~10 downloads + rehydrations for archive blobs |
| 100 | ~100 downloads + rehydrations for archive blobs |
| 1000 | ~1000 downloads + rehydrations for archive blobs |
Pattern observation: The number of operations grows directly with the number of blobs accessed.
Time Complexity: O(n)
This means the time to access data grows in direct proportion to the number of blobs you work with.
[X] Wrong: "Accessing archive blobs is as fast as hot or cool blobs."
[OK] Correct: Archive blobs need extra steps like rehydration, which adds time and API calls before data can be read.
Understanding how storage tier operations scale helps you design efficient cloud solutions and explain trade-offs clearly in real projects.
"What if we batch multiple blob downloads in parallel? How would the time complexity change?"
Practice
Solution
Step 1: Understand storage tier purposes
The Hot tier is designed for data that is accessed often and requires fast retrieval.Step 2: Compare with other tiers
Cool tier is for infrequent access, Archive is for rarely accessed data, and Premium is a performance option but not a tier for access frequency.Final Answer:
Hot tier -> Option DQuick Check:
Frequent access = Hot tier [OK]
- Confusing Cool tier with Hot tier
- Thinking Archive tier is for frequent access
- Assuming Premium tier is a storage access tier
Solution
Step 1: Identify correct command for blob tier
The command to set a blob's tier isaz storage blob set-tier.Step 2: Choose correct tier parameter
To set the Archive tier, use--tier Archive. Setting tier on storage account level is invalid.Final Answer:
az storage blob set-tier --tier Archive -> Option CQuick Check:
Blob tier set with az storage blob set-tier [OK]
- Trying to set tier on storage account instead of blob
- Using wrong command like az storage blob update
- Confusing tier names or casing
{
"rules": [
{
"name": "moveToCool",
"type": "Lifecycle",
"definition": {
"actions": {
"baseBlob": {
"tierToCool": { "daysAfterModificationGreaterThan": 30 }
}
},
"filters": { "blobTypes": ["blockBlob"] }
}
}
]
}What happens to blobs older than 30 days?
Solution
Step 1: Analyze lifecycle rule action
The rule specifiestierToCoolfor blobs modified more than 30 days ago.Step 2: Understand effect on blobs
Blobs older than 30 days are automatically moved to the Cool tier to save cost.Final Answer:
They are moved to Cool tier -> Option BQuick Check:
30+ days old blobs -> Cool tier [OK]
- Assuming blobs move to Archive instead of Cool
- Thinking blobs are deleted by this rule
- Confusing tierToCool with tierToHot
Solution
Step 1: Recall Archive tier scope
Archive tier is applied per blob, not at the storage account level.Step 2: Understand error cause
Trying to set Archive tier on the whole account causes an error because it's unsupported.Final Answer:
Archive tier can only be set on individual blobs, not on the whole account -> Option AQuick Check:
Archive tier scope = per blob [OK]
- Thinking Archive tier needs special enablement
- Assuming Archive tier requires Premium account
- Confusing Archive tier with file share tiers
Solution
Step 1: Identify access frequency and cost needs
Videos are rarely accessed and cost minimization is priority, so Archive tier fits best.Step 2: Consider retrieval delay tolerance
Archive tier retrieval can take hours, which is acceptable here.Step 3: Evaluate other options
Hot tier is costly, Cool tier is more expensive than Archive, Premium is for performance, not cost saving.Final Answer:
Store videos directly in Archive tier -> Option AQuick Check:
Rare access + low cost = Archive tier [OK]
- Choosing Hot or Premium tier for rarely accessed data
- Using Cool tier without moving to Archive
- Ignoring retrieval delay tolerance
Ready to prove it?
Pass the test and this pattern moves unknown
