Azure Storage Services - Blob, Disk, File And Archive

While designing any application, the most important aspect we consider is data flow in application. How we capture, process and store data is the core of any application. In case of cloud application we can use Azure storage services. This service can be used for non-cloud application as well. Non-cloud means even if application is hosted on private server we can use Azure Cloud Storage.

Storage can be anything which we store using application like Data, Files, Images, Videos, etc. For such different type of storages Azure have a dedicated storage service, in this article we are going to discuss one by one.

There are products available for Storage such as Blob Storage, File Storage, Queue Storage, Table Storage, Disk Storage, and Storage Tiers. 

Most important storage is data storage, here we can consider Table storage is used for data storage. There are 3 ways to store data as below

  1. Structured
    Data stored using tables with very strict schema. Each row has defined schema/structure. Some tables have defined relationships between them (Primary and Foreign Keys). Typically used in relational databases.
     
  2. Semi-structured
    Data stored using tables but without strict defined schema/stricture. Rows must only have unique key identifier only, other columns can vary.
     
  3. Unstructured
    In this format data/files can be stored in any format. Like binary files, application files, images, movies, etc.

Storage Account

This is a group of services which include Blob Storage, File Storage, Queue Storage, Table Storage used to store Files, Messages, Structured and semi-structured data with advantages of Highly scalability(up to petabytes of data), Highly durable (99.999999999%) and Cheapest per GB storage 

Blob Storage

BLOB stands for Binary large object which is mostly files, this type of storage is designed to store large files of any type/kind. Blob has 3 storage tiers

  1. Hot - Frequently accessed data
  2. Cool -  infrequently accessed data (high durability, lower availability)
  3. Archive – rarely accessed data. To use Blob storage you need to use below Namespaces 
using Microsoft.WindowsAzure; // to access CloudConfigurationManager  
using Microsoft.WindowsAzure.Storage; // to access CloudStorageAccount  
using Microsoft.WindowsAzure.Storage.Blob; // to access Blob storage types  
using Microsoft.Azure; // to access CloudConfigurationManager  

When you want to store data to Blob below code will help you to understand how actual file will get stored 

public void SaveDataToBlob(PostedFile objFile) {
    HttpWebRequest requestPage = (HttpWebRequest) WebRequest.Create(objFile.filePath);
    HttpWebResponse responseRequest = (HttpWebResponse) requestPage.GetResponse();
    CloudBlockBlob objBlob = blobcontainer.GetBlockBlobReference(objFile.filename); //Create a Blob  
    //Store file on Azure Blog 
    objBlob.UploadFromStream(responseRequest.GetResponseStream());
}

Queue Storage

Queue Storage is used to store small data like messages, it is designed for scalable asynchronous processing. This type of storage can store millions of messages with maximum size of 64 KB. Upper limit can be set by the type of storage account. URL of the queue is like below 

https://<account>.queue.core.windows.net/<queue>

When you want to use this storage in your application you need to install and add references. below are the steps to use the Azure Queue 

PM> Install-Package Azure.Storage.Queues

Once you install the package, you need to create azure queue storage client 

public static void QueueClient(string queuename) {
    string conStr = “Your Azure Storage Connection String”;
    QueueClient qClient = new QueueClient(conStr, queuename);
}

If you want to send message or store message using azure queue storage you can use below code 

string message = "My First message";
qClient.CreateIfNotExists();
if (qClient.Exists()) {
    qClient.SendMessage(message);
    return true;
}

Disk Storage

This is the most important storage in cloud/Azure used for emulation in the cloud, it is Persistent storage for Virtual Machines. it has different sizes, types, performance tiers. It is used to install operating system and other softwares and can be used as a content server.

File Storage

Azure Files is a cloud storage service developed to share files, development tools and applications. with the help of Azure files you can share your files and manage them.

This storage is mainly used for File Servers, Application shares, development and testing, lift and shift migrations, etc.  There are few advantages and disadvantages of using Azure File storage. advantages like Shared access, fully managed service, redundancy, easy API. few disadvantages like performance, security, size limitations, backup, etc.

Overall if we analyze the services offered by Azure they are quite promising. If we need to develop an application of any size (small or enterprise), Azure storage can fulfill the requirements.

__Happy Coding__


Similar Articles
Blue Ocktopus Technology Systems Private Limited
Enabling revenue generation through brand loyalty and customer retention for enterprise retail and e