Azure Blob Storage vs File Storage

Microsoft offers several options to store data on the cloud. Each option has its unique purpose for serving different business needs. One of the significant capabilities that Microsoft Azure provides is the agility to migrate to different storage options if required.

There are various options available in the Azure Storage Account for storing user data.

  • Blob Storage
  • File Storage
  • Table Storage
  • Queue Storage
  • Disk

Blob Storage

Azure Blob Storage is an object storage solution for the cloud. Blob Storage allows you to store a massive amount of unstructured data. The unstructured data need not be of the specific data model.

Azure Blob Storage was designed to serve specific needs. If your business use case needs to store unstructured data like audio, video, images, etc then you should probably go with this option. The objects which are being stored in Blob does not necessarily have an extension.

The following points describe the use case scenarios:

  • Serving images or documents directly to a browser
  • Storing Files for distributed access
  • Streaming video and audio
  • Writing to log Files
  • Storing data for backup, restore, disaster recovery and archiving
  • Storing data for analysis by an on-premises or Azure-hosted service

File Storage

Azure Files offer fully managed File shares in the cloud that are accessible via the industry-standard SMB. Azure File shares can be mounted concurrently by cloud or on-premises deployments of Windows, Linux, and macOS. It can be cached on Windows servers with Azure File Sync for faster access.

File Storage can be used if your business use case needs to deal mostly with standard File extensions like *.docx, *.png and *.bak then you should probably go with this storage option.

The following points describe the use case scenarios: 

  • Replace or supplement on-premises File servers
  • “Lift and shift” applications
  • Simplify cloud development

Real-time Scenario

Consider a scenario, in a development environment where every developer needs access to IDE and tools without using the internet to download it. At this situation, Azure Blob Storage would meet the need and using which you can only store development tools then give a link to the team to access the Blob location.

For implementing a File server in your organization, you should choose the Azure Files option. A File server is used to share Files across departments in your organization. When it comes to File sharing, end-user should not be allowed to access the copies of the File from its URI and need to be mapped locally in the computers. This is when Azure File Storage fits your need.

Large File Uploading

The common approach used to upload a large File is to split it into chunks. Splitting is not only the function to upload files, but the chunks must be merged into a File once the upload is complete.

For the above task, which option would be a good fit? Azure Blob or File Storage?

The answer is Azure Blob Storage. Though this scenario deals with Files, Azure Blob Storage is a good fit due to its off the shelf capabilities.

Azure Blob Storage contains three types of blobs: Block, Page and Append. A block is a single unit in a Blob. A Blob can contain many blocks but not more than 50,000 blocks per Blob. This means you can split a Blob into 50,000 blocks to upload to Azure Blobs storage. The minimum size of a block is 64KB and maximum is 100 MB. If you look at (for example .NET library), one of the objects is BlockBlob which is part of CloudBlockBlob class. This class offers you tons of things to work with a Block Blob.

For example, StreamWriteSizeInBytes property allows you to set a block Blob size that can be good to handle unstable network speed. Each block Blob also has metadata to allow you to control individually. For example, you want to make sure all the block Blobs are successfully committed to a given Blob, you can use Content-MD5.

Azure File Storage does not have this out-of-the-box capability. If you need to split File, you need to find an indirect method like FileStream class or use third-party vendors.

Monitoring Options Available for Blob Storage and File storage

Once you configured the desired Storage Account to the Diagnostics option under the Monitoring section, you will be able to define the type of metrics data you wish to monitor and the retention policy for the data.

A default set of metrics is displayed in charts on the Storage Account blade, as well as the individual service blades (Blobs and Files). Once you’ve enabled metrics for a service, it may take up to an hour for data to appear in its charts. You can select Edit on any metric chart to configure which metrics to be displayed in the chart.

Azure portal storage monitoring option

Scalability

It is significant to know the quota and limits of Azure Storage to choose the right option. The highest level of representation for capacity in Azure Blob Storage is Containers, whereas for Files is Shares.

Azure Blobs ResourceTarget
Max size of single Blob container500 TB
Max number of blocks in a block Blob or append Blob50,000 blocks
Max size of a block in a block Blob100 MB
Max size of a block Blob50,000 X 100 MB (approx. 4.75 TB)
Max size of a block in an append Blob4 MB
Max size of an append Blob50,000 x 4 MB (approx. 195 GB)
Max size of a page Blob8 TB
Max number of stored access policies per Blob container5
Azure Files ResourceTarget
Max size of a File share5 TB
Max size of a File in a File share1 TB
Max number of Files in a File shareNo limit
Max IOPS per share1000 IOPS
Max number of stored access policies per File share5
Maximum request rate per Storage Account20,000 requests per second for Files of any valid size
Target throughput for single File shareUp to 60 MB per second
Maximum open handles for per File2000 open handles
Maximum number of share snapshots200 share snapshots

Security

Azure Storage Blob and Files Storage Service Encryption as they come under Azure Storage Account level. When the application writes/reads a new Blob/File, they are encrypted using 256-bit AES (Advanced Encryption Standard) algorithm. If calling via REST API, both Azure Blobs and Azure Files are supported by enabling Secure Required Transfer

Both Azure Blobs and Azure Files need Shared Access Signature (SAS) to get delegated access to Blobs and Files. In addition to authorization, both are supported with Azure AD and shared access token.

Azure Blobs allow achieving encryption by BlobEncryptionPolicy class with Azure Key Vault. Azure Files use built-in encryption in the SMB 3.0 protocol. Also, both Azure Blobs and Azure Files support CORS (Cross-Origin Resource Sharing) rule. CORS allows you to describe the whitelist for HTTP header request.

As far as network security is concerned, you have more control of incoming network traffic to both Azure Blobs and Azure Files. It only allows a specified IP range and virtual networks to access it. 

Disaster Recovery

Data backup is significant for any enterprise where the data is considered as blood of their organization. Unfortunately, Azure recover and back-up do not have automation to back-up data right from Blob and File Storage. To handle, data can be downloaded the data down to your on-premises infrastructure or create a new Storage Account in another region to store your data.

Azure Blobs: Use Copy Blob to asynchronously copy your Blob to destination Storage Account.

Azure Files: Use Copy File to asynchronously copy File share to destination Storage Account.

Pricing

Pricing described here is based on the Microsoft documentation

Data Storage Prices

Below are prices for storing data in Azure File and Blob Storage

Blob StoragePREMIUMHOTCOOLARCHIVE
First 50 terabyte (TB) / month$0.18 per GB$0.022 per GB$0.01 per GB$0.00099 per GB
Next 450 TB / Month$0.18 per GB$0.0212 per GB$0.01 per GB$0.00099 per GB
Over 500 TB / Month$0.18 per GB$0.0203 per GB$0.01 per GB$0.00099 per GB
File StorageSTANDARD
GB/month$0.06 per used GB
Snapshots GB/month$0.06 per used GB

Operations and Data Transfer prices

Below are prices for Operations and Data Transfering in Azure File and Blob Storage

Blob StoragePREMIUMHOTCOOLARCHIVE
Write operations (per 10,000)1$0.021$0.05$0.10$0.11
List and Create Container Operations (per 10,000)2$0.06$0.05$0.05$0.05
Read operations (per 10,000)3

Archive High Priority Read (per 10,000)5
$0.0017$0.004$0.01$5.50

$30
All other Operations (per 10,000), except Delete, which is free$0.0017$0.004$0.004$0.004
Data Retrieval (per GB)4

Archive High Priority Retrieval (per GB)5
FreeFree$0.01$0.022

$0.06
Data Write (per GB)4FreeFree$0.0025Free
File StorageSTANDARD
Put, Create Container Operations (per 10,000)$0.015
List Operations (per 10,000)$0.015
All other operations except Delete, which is free (per 10,000)$0.0015
Geo-Replication Data Transfer (per GiB)N/A

Wrap Up

In the revolution of digital transformation, applications are being modernized and it needs large-scale pattern not only in the application layer but also in the data layer which I don’t think Azure Files can fit. Azure Files would be still good if your application is served for a specific audience.

Perhaps, there are individual aspects to be considered before concluding the best option between Azure Blob Storage and Files. Taking the common functionalities into consideration, I would prefer Azure Blob Storage rather than Files.