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.
What is Azure 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.
What is Azure 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.
What is the difference between blob and file storage?
Azure Blob Storage is an object store used for storing vast amounts unstructured data, while Azure File Storage is a fully managed distributed file system based on the SMB protocol and looks like a typical hard drive once mounted.
What is Azure Blob Storage used for?
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
Use of File Storage
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
How does BLOB storage work?
Blob Storage comprises of three different types of resources:
- The Storage Account
- A container in the storage account
- A blob in a container
What can you store in a blob container inside Azure storage?
A blob container is similar to a directory in a file system which organises the blobs. A storage account can include an unlimited number of containers, and a container can store an unlimited number of blobs.
What can be stored in Azure Blob Storage?
Data stored inside a blob container is classified and the blob itself is divided into three based on the data being stored on it.
- Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually. Block blobs can store up to about 190.7 TiB.
- Append blobs are made up of blocks like block blobs, but are optimized for append operations. Append blobs are ideal for scenarios such as logging data from virtual machines.
- Page blobs store random access files up to 8 TiB in size. Page blobs store virtual hard drive (VHD) files and serve as disks for Azure virtual machines.
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: Why do we use BLOB storage?
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 the 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.
How do I access files from blob storage?
Files from blob storage can be downloaded into our local machine and accessed from there. Due to this users need to install Azure Storage Explorer or other third-party tools like Cerulean, etc.
The following steps can be followed by a user to access their file content from blob storage.
- Open Cerulean
- From the All Resources section select Storage accounts
- Now open the required storage account and under primary expand the required blob container
- Now user can use the open icon available for each blob container
- In the manage window user can download the file contents into their local machine
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.
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 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
Operations and Data Transfer prices
Below are prices for Operations and Data Transfering in Azure File and Blob Storage
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.