3.1.5.1. Design for Data Lifecycle Management
3.1.5.1. Design for data lifecycle management
💡 First Principle: Automating data movement and retention across storage tiers based on predefined rules is essential for optimizing costs, ensuring compliance, and reducing manual operational overhead.
Scenario: You are managing a large volume of IoT telemetry data stored in Azure Blob Storage. This data is actively analyzed for the first 90 days, then accessed only occasionally for reporting for the next year, and finally needs to be retained for 5 years for auditing before being permanently deleted.
Data lifecycle management (DLM) is a feature in Azure Blob Storage that automates the process of tiering and deleting data based on predefined rules.
Key Design Considerations:
- Policy Definition: Define lifecycle rules using data age, last access time, or tags to trigger transitions or deletions.
- Tiering: Automate movement between Hot (frequent), Cool (infrequent), and Archive (rare) tiers to match usage and minimize costs.
- Deletion: Set policies for automatic deletion of expired or unneeded data, reducing storage bloat and compliance risks.
- Compliance: Ensure lifecycle policies align with legal and regulatory requirements (e.g., GDPR, HIPAA) for retention and deletion.
- Cost Savings: Automated tiering and deletion lower storage expenses by keeping only active data in premium tiers and removing obsolete data.
Design decisions in practice:
| Decision | Guidance |
|---|---|
| What drives the rule | Blob age since creation, since last modification, or since last access. Last-access tracking must be enabled explicitly and adds a small cost, but it is the only signal that reflects real usage rather than assumed usage |
| Where rules apply | Scope by prefix and by blob index tag, so a policy can treat raw/ differently from curated/ in the same account |
| Snapshots and versions | Have their own rules. Forgetting them is how an account keeps paying Hot prices for prior versions of data whose current version was tiered long ago |
| The delete action | Lifecycle can delete as well as tier. Combined with an immutability policy, the delete simply fails until retention expires — which is the intended interaction, not a conflict |
Tier by the read pattern, and know the two costs that bite. Each cooler tier has a minimum retention period, and moving data out early incurs an early deletion charge for the remainder — so tiering data that turns out to be read repeatedly costs more than leaving it alone. And rehydrating from Archive takes hours, at standard or high priority, which is why any requirement mentioning immediate access rules Archive out.
⚠️ Exam Trap: a lifecycle policy is evaluated once a day, not continuously. A scenario expecting a blob to move tiers the moment it stops being read is describing behaviour the feature does not have.
⚠️ Common Pitfall: Creating lifecycle policies based on creation date when access patterns are the more relevant factor. For unpredictable access, using the "last accessed" condition in a lifecycle rule is more effective for cost optimization.
Key Trade-Offs:
- Rule-based (Lifecycle Policy) vs. Access-based (Intelligent Tiering): Lifecycle policies are ideal for predictable aging patterns. For unpredictable access, Azure Storage's Intelligent Tiering feature (which automatically moves data based on actual access) might be a better, though slightly different, approach.
Practical Implementation: Conceptual Lifecycle Rule
// A rule to move blobs with prefix 'iot-data/' to Cool after 90 days,
// then to Archive after 365 days, and delete them after 1825 days (5 years).
{
"rules": [
{
"name": "iot-data-lifecycle",
"enabled": true,
"type": "Lifecycle",
"definition": {
"filters": {
"blobTypes": [ "blockBlob" ],
"prefixMatch": [ "iot-container/iot-data/" ]
},
"actions": {
"baseBlob": {
"tierToCool": { "daysAfterModificationGreaterThan": 90 },
"tierToArchive": { "daysAfterModificationGreaterThan": 365 },
"delete": { "daysAfterModificationGreaterThan": 1825 }
}
}
}
}
]
}
Reflection Question: How does designing for data lifecycle management (DLM), using policy definitions to automate data movement across storage tiers and eventual deletion, fundamentally optimize costs and enforce data retention and compliance by reducing manual effort?