Book a Demo Free Trial

Optimize your storage costs by moving blob snapshots and versions to cool/archive tier from hot tier

Ranjith Eswaran

May 18, 2021

Category: Azure Storage

Introduction

Blob storage is the Object storage solution offered by Microsoft. We can store data in all formats like text, images, videos, or binary data. It is optimized to store massive unstructured data. The blobs can be either block blob, append blob, or page blob.

  1. Block blobs store blocks of text or binary data.
  2. Append blobs are a collection of block blobs that are optimized for append operations.
  3. Page bobs can serve as hard disks for Azure virtual machines.

Blob snapshots

Blob snapshots are the read-only version of the blobs that can be taken at any point in time. The base blob and its snapshots share the same base URI. The snapshots will have the DateTime value appended to the base URI which refers to the time at which the snapshot is taken. The snapshots can be copied, read, and deleted, but they cannot be modified. Leases cannot be acquired on the blob snapshots.

Blob versions

Versioning can be enabled on Blob storage to maintain the previous versions of an object automatically. Previous versions of the blob can be restored if there are any erroneous modifications or deletion of the blobs when versioning is enabled. Versioning captures the state of a blob at a given point in time. Each version is identified with a unique identifier. There can only one current version of a blob at a time. Blob versions are immutable. So, it is not possible to modify the contents and metadata of the blob versions. Blob versions will not be useful in the accidental deletion of a storage account or container.

Impact of snapshots on billing

  • When a block blob is updated by calling a method that updates all the contents of the blob, then all blocks in the blob will be replaced. When a snapshot is associated with the updated blob, then all the blocks in the base blob and snapshot will diverge even if they have the same contents. This will result in the cost for all the blocks in both blobs.
  • When a particular block in a block blob is modified, that block is particularly charged as a unique block. This holds true when the contents and block id are in both the snapshot and block blob. When the block is committed, the snapshot diverges from the base blob and charges will be incurred for its data.
  • Charges are incurred for unique blocks or pages, whether they are in blobs or in snapshots. There is no additional cost for the snapshots unless the blobs are modified. When the blobs are updated, they diverge from the snapshot and the charges are incurred.
  • Azure Blob service cannot find if two blocks have the same block id and same content. So, all the content that is uploaded is treated as unique block id and unique block, and charges are incurred for it.

Impact of Access tier on Billing

There are three access tiers available in Storage accounts. They are: Hot, Cool and Archive.

  1. Hot: This tier incurs a high storage cost, but the access cost is low.
  2. Cool: This tier is used for storing data that is infrequently access and stored for at least 30 days. The storage cost is lower than that of the Hot access tier.
  3. Archive: This tier is optimized for storing that are rarely accessed and stored for at least 180 days. This is the cheapest access tier from a storage costs point of view.

Reduce the cost of blob snapshots

  • Snapshots can be deleted and recreated if the blob is modified even if it is going to be updated with the same content. This can be done in cases where there is no need to maintain the snapshots. By doing so, we can maintain the blobs and snapshots without diverging.
  • When the blobs are updated, try to update the minimum number of blocks instead of updating the entire blob to keep the cost minimum.

Reduce the cost of blobs by moving the snapshots and versions to cool/archive access tier

In most cases, the snapshots and the versions of the blobs will not be frequently accessed by the users and applications. When these snapshots and versions are maintained in the hot access tier, the cost spent on these snapshots and versions is unnecessary.

Let us consider a scenario where the block blob size is 1 MB whose storage account is enabled with versioning and a snapshot is created every three hours to meet the business requirement and SLA. In this case, the cost spent on the snapshots of the blob will be huge and is of no use if the snapshot is in Hot access tier.

In similar scenarios, we can change the access tier of the snapshots and versions to cool or archive access tier based on the frequency in which the snapshots and versions will be accessed.

Changing the access tier of Snapshots and Versions

It is not possible to change the access tier of the blobs and versions directly through the Azure portal. But we can use the REST APIs to change the access tier of the snapshots and versions. To do this, we need to fetch all the snapshots and versions and iterate them to move them to the required access tier. It requires considerable effort to implement such a solution.

Changing the access tier of blobs, snapshots, and versions through Cerebrata

Cerebrata allows us to effectively manage the Blob snapshots and versions in a much easier and an effective manner. In this section, we will talk about how we can manage the blob snapshots and versions using Cerebrata.

Managing blob snapshots

Cerebrata allows us to list and view the properties and metadata of the snapshots of a blob in a storage container. Please follow the below steps to manage the blob snapshots.

  1. Navigate into the required container in the Storage account.

2. Select the required blob to view the snapshots.

3. Right click on the selected item and select Blob snapshots in the context menu.

4. All the available blob snapshots will be listed.

5. We will be able to perform the following operations on the blob snapshot.

  • View Properties, Metadata, Tags
  • Generate Shared Access Signature
  • Open and download
  • Promote
  • Delete

6. We will also be able to change the access tier of the blob snapshot by following the below steps.

a. Select the change access tier option.

b. Select the required access tier

c. Click Save to change the access tier of the blob snapshot

Managing blob versions

Please follow the below steps to manage the blob versions.

  1. Navigate into the required container in the Storage account.

2. Select the required blob to view the versions.

3. Right click on the selected item and select Blob Versions in the context menu.

4. All the blob versions will be listed.

5. We will be able to perform the following operation on the blob versions.

  • View Properties, Metadata, Tags
  • Generate Shared Access Signature
  • Open and download
  • Promote
  • Delete

6. We will also be able to change the access tier of the blob version by following the below steps.

a. Select the change access tier option.

b. Select the required access tier.

c. Click Save to change the access tier of the blob version

Changing the access tier of blobs, snapshots, and versions in bulk

It is also possible to change the access tier of snapshots and versions along with the blob. Please follow the below steps to perform this operation.

  1. Select the required blobs whose access tier or snapshot/version’s access tier must be updated.

2. Select the Access tier option in the top menu.

3. Select the required access tier to which the blobs, snapshots and versions should be moved.

4. Click on the Submit button to initiate the operation.

5. All the selected blobs together with their snapshots and versions will be moved to the required access tier selected.

6. It is also possible to perform this operation on all the blobs in the container by selecting the Change Access tier (All blobs) option from the context menu of the container.

Conclusion

In this blog we discussed about the blob snapshots and versions along with their influence on Azure storage cost. We also discussed on how the additional cost due to snapshots and versions can be minimized by changing their access tier using Cerebrata in a much efficient and easier manner.  

Apart from Azure Storage, Cerebrata enables you to manage your Azure Cosmos DB accounts (SQL API, Gremlin API, and Table API), Service Bus Namespaces, Cognitive Search Service accounts, Redis Cache accounts, and much more. It is also cross-platform so that you can manage your Azure resources from a platform of your choice – Windows, Mac, or Linux.

If you wish to experience Cerebreta, try our 15 days free trial.