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
This blog tries to differentiate between Azure Blob Storage and File Storage which is available in Azure Storage Account.
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 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.
When to Use
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 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
Free download this blog as a PDF document for offline read.
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.
Serverless360 (Off the Shelf Product)
It is possible to monitor both Storage Blobs and Storage Files in a Status or Threshold monitor. Status Monitor generates a report at specific times in a day representing the state of the entities against the desired values. Threshold Monitor generates a report when certain properties violate desired values for a specified period. Predominantly, Serverless360 monitors the Blobs and Files based on its properties rather than its metrics, unlike Azure Portal.
|Entity Type||Properties those can be monitored|
|Storage Blob||Lease State, Blob Count, Blob Size (Bytes), Block Blob Count, Block Blob Size (Bytes), Page Blob Count, Page Blob Size (Bytes), Append Blob Count, Append Blob Size (Bytes)|
|Storage File||Usage (Bytes)|
Below image depicts the Blob configuration in the Status Monitor of the Serverless360 application.
Below is the error detail generated if the error persists for the desired period.
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 Resource||Target|
|Max size of single Blob container||500 TB|
|Max number of blocks in a block Blob or append Blob||50,000 blocks|
|Max size of a block in a block Blob||100 MB|
|Max size of a block Blob||50,000 X 100 MB (approx. 4.75 TB)|
|Max size of a block in an append Blob||4 MB|
|Max size of an append Blob||50,000 x 4 MB (approx. 195 GB)|
|Max size of a page Blob||8 TB|
|Max number of stored access policies per Blob container||5|
|Azure Files Resource||Target|
|Max size of a File share||5 TB|
|Max size of a File in a File share||1 TB|
|Max number of Files in a File share||No limit|
|Max IOPS per share||1000 IOPS|
|Max number of stored access policies per File share||5|
|Maximum request rate per Storage Account||20,000 requests per second for Files of any valid size|
|Target throughput for single File share||Up to 60 MB per second|
|Maximum open handles for per File||2000 open handles|
|Maximum number of share snapshots||200 share snapshots|
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.
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 described here is based on the Microsoft documentation
Data Storage Prices
Below are prices for storing data in Azure File and Blob Storage
|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|
|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
|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
|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
|Data Write (per GB)4||Free||Free||$0.0025||Free|
|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|
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.