Blob Access Tiers
Azure Blob Storage offers different access tiers to optimize costs by storing infrequently accessed data in a cost-effective manner. Choosing the right tier for your data can significantly reduce your storage expenses.
Understanding Access Tiers
Blob Storage provides three main access tiers:
- Hot tier: Optimized for frequently accessed data. This tier offers the lowest access latency and the highest transaction costs.
- Cool tier: Optimized for infrequently accessed data. This tier is suitable for data that is accessed less than once a month. It has higher storage costs than the archive tier but lower access latency and transaction costs.
- Archive tier: Optimized for rarely accessed data that can tolerate longer retrieval times. This tier offers the lowest storage costs but the highest retrieval costs and latency. Data must be rehydrated before it can be read or modified.
Note: Access tiers apply to individual blobs, not to entire containers.
When to Use Each Tier
Here's a guide to help you decide which tier best suits your data:
- Hot tier: Use for data that is actively being used, such as website content, active application data, and frequently updated logs.
- Cool tier: Ideal for backups, disaster recovery data, older logs, and data that needs to be retained for compliance but isn't accessed regularly.
- Archive tier: Best for long-term archival, regulatory compliance archives, and historical data that might be needed but is rarely accessed. Retrieval can take hours.
Key Considerations for Access Tiers
When choosing an access tier, consider the following:
- Access frequency: How often do you anticipate accessing the data?
- Retrieval time: How quickly do you need to access the data if it's in the cool or archive tier?
- Cost: Storage costs, access costs, and retrieval costs vary significantly between tiers.
| Feature | Hot Tier | Cool Tier | Archive Tier |
|---|---|---|---|
| Storage Cost | Highest | Medium | Lowest |
| Access Cost | Lowest | Medium | Highest |
| Retrieval Latency | Lowest (milliseconds) | Moderate (milliseconds to seconds) | High (hours) |
| Minimum duration | None | 30 days | 180 days |
| Use Case | Frequently accessed data | Infrequently accessed data | Rarely accessed data, long-term archival |
Managing Blob Access Tiers
You can set the access tier for a blob when you upload it or change the tier of an existing blob. This can be done using:
- Azure portal
- Azure CLI
- Azure PowerShell
- Azure Storage SDKs
- REST API
Changing Blob Tier
To change the tier of an existing blob, you can use the Set Blob Tier operation. For example, using the Azure CLI:
az storage blob set-tier --account-name <your-storage-account-name> \
--container-name <your-container-name> \
--name <your-blob-name> \
--tier Hot|Cool|Archive
Tip: Consider using lifecycle management policies to automatically transition blobs between tiers based on their age or access patterns.
Rehydrating Archived Data
When data is stored in the archive tier, it is offline. To access archived data, you must first "rehydrate" it. This process involves copying the blob to either the hot or cool tier. Rehydration can take a few hours, depending on the amount of data and the capacity of the storage account.
Rehydration Methods
- Copy Blob: Copy the archived blob to a new blob in the hot or cool tier.
- Set Blob Tier: Change the tier of the blob to hot or cool.
The following Azure CLI command demonstrates rehydrating an archive blob to the cool tier:
az storage blob set-tier --account-name <your-storage-account-name> \
--container-name <your-container-name> \
--name <your-blob-name> \
--tier Cool
Best Practices
- Regularly review your data access patterns to ensure blobs are in the most cost-effective tier.
- Utilize Azure Lifecycle Management to automate tiering.
- Be aware of the minimum duration for cool and archive tiers to avoid early deletion penalties.
- Plan for rehydration times if you anticipate needing to access archived data frequently.