Azure Storage account is a cloud-based PaaS service for persisting and retrieving data. Data can be sorted from anywhere just by using URLs, the REST interface, or by using one of the Azure SDK storage client libraries. This is one of the cloud storage solutions provided by Azure. It is a highly scalable and elastic service. Every storage account has a name that is always unique throughout Azure.
Let’s understand some key concepts for Azure Storage account. This will definitely help you in case you are planning for an Azure certification exam like AZ-900, AZ-204, AZ-104 and AZ-303.
Azure Storage Types
Azure storage accounts can store a multitude of different types of data including blobs, files, tables, and queues. Let's talk about each of these in more detail to get a better understanding of what we truly can store within an Azure storage account.
Blobs/Containers
- This is an object storage and can store massive amounts of unstructured data on the cloud.
- This is highly recommended when you want to store objects or blobs such as images, documents, videos and audio files.
- Within the blob service, you need to create a container that is used to store the blob object.
- This type pf storage is also used for storing your disk files for your virtual machine. When the VM has to store its disk onto Azure, it’s actually stored in a storage account using the blob service and all of these are stored as virtual hard disk files or VHDs.
- There are different types of blobs that are available:
- Block blobs
This are used for storing text and binary data.
- Append blobs
This is ideal for logging data. If you have log files that need to be stored in the Azure blob service, you can make use of it.
- Page blobs
This is used to store virtual hard disk files for Azure virtual machines.
Tables
- Table storage service is a data store for structured data in the NoSQL sense of structured data.
- Entities are stored with key/value or key/attribute pairs.
- It is schema-less, which means you can decide your key attribute pair collections and that can vary from one entity to another.
- Use this storage service when you want to have a very simple structure for your tables and you want to have quick access for tables as well from your application.
Queue
- Queue storage service is essentially a queuing service built on Azure Storage.
- It’s almost similar in behavior with Microsoft Message Queuing, or MQSeries, or Service Bus.
- This is useful for decoupling b/w different components of your application. When an application has different components and one component of the application needs to send a message to another component, in that case we can use queue storage to store messages to the queue and then the other component can pick up the message from that Queue.
Files
- File storage service is basically an SMB file share. So you would connect to the file share using the SMB (Server Message Block) protocol.
- It can be accessed like a traditional file share.
- Share files b/w multiple VMs and It could be virtual machines in Azure, but also on premise virtual machines.
Azure Storage Account Types
Azure Storage offers several types of storage accounts. Each type supports different features with different pricing models. In Azure portal, it’s called Account kind.
General-purpose v2
This is the most commonly used type of storage account. This is recommended by Microsoft for most scenarios. This type of storage account provides blob, file, queue and table service.
General-purpose v1
This type of storage account provides the same level of services as general purpose V2 but then this is the older version of this account type. It is recommended to choose general purpose general purpose V2 accounts, if you want to make use of the latest features for storage accounts.
Block blob storage
This type of storage is specifically for when you want premium performance for storing block and append blobs. It's useful when high transactions rates, or scenarios that use smaller objects or require consistently with low storage latency.
File storage
This is again specifically used when you want premium performance for file-only storage.
Blob storage
This is a legacy storage account. If we need to use blobs, then make use of general purpose V2 accounts.
Azure Block Blob Storage - Access tiers
Azure Storage provides different options for accessing block blob data based on usage. Below are available access tiers,
- This is optimized for storing data that's accessed frequently.
- This tier can be set at the account level and this default is selected while creating storage account.
- Storage costs are higher than cool access tier but access cost is lower.
- This is optimized for storing data that is infrequently accessed and stored for at least 30 days.
- This tier can also be set at the account level.
- Storage costs are lower than the hot tier but then when you want to access a blob in the cool tier then the access costs are higher.
- This is optimized for storing data that's rarely accessed and stored for at least 180 days.
- This tier is available only for individual block blobs
- When a blob is in the archive tier you can't access the data in that blob. In order to access the data, you first have to rehydrate the blob before it can be accessed.
- Storage costs are the least when it comes to the archive tier, but the access costs are the highest.
Azure Storage Account Replication Strategy
When planning your usage of Azure storage accounts, one consideration will be high availability. Will the data stored in the storage account be available even though regional outage? Let’s understand different replication techniques of storage account.
Locally-redundant storage(LRS)
- This is a default option that you can choose for your storage account.
- In LRS, underlying data is copied/replicated synchronously three times within a physical location in the primary region; that means within one physical location your data is replicated three times.
- If any part of the physical location goes down, you still have other data sources in place. But If the entire data center goes down, then your data won’t be available.
Zone-redundant storage (ZRS)
- In ZRS, data is copied/replicated synchronously across three availability time zones from the primary region. This is a good option when you want to have your data in place, even in the event of a data center failure.
- In zone redundant storage your data is replicated across multiple data centers via their logical availability Zone representation. So even if one data center were to go down, you would still have a copy of your data available.
- Zone redundant is more highly available than locally redundant storage.
Geo- redundant storage (GRS)
- In GRS, data is replicated three times synchronously within a primary region and then is also replicated asynchronously onto a secondary region. This is required when there is a requirement to implement a disaster recovery scenario.
- If primary region goes down and if you still want to have your data in place, you can access your data from a secondary region and the secondary region data will only be available if the primary region goes down.
- Geo redundant storage is more highly available in terms of your data than zone redundant storage this is because your data is being replicated across onto another region. So you're paying for your data storage in both regions as well as for the data transfer.
Read access geo redundant storage (RA-GRS),
- In the case of Geo- redundant storage, the data in the secondary region is only available if the primary region goes down. But in read access Geo redundant storage, even though your primary region is still available you can have a read only copy of your data in the secondary region also available to access as well.
Geo zone redundant storage (GZRS) (preview),
- In GZRS, data is replicated synchronously across three availability zones in the primary region and then replicated asynchronously onto a secondary region.
Read Access geo zone redundant storage (RA-GZRS) (preview):
- In RA-GZRS, data is replicated synchronously across three availability zones in the primary region and then replicated asynchronously onto a secondary region. Here the data in secondary region is also available for read-only purpose.
Storage Account Pricing
Azure Storage account costs are calculated based on multiple factors as mentioned below,
- You will incur a cost based on the region you used to store the data.
- Type of storage account and data usage pattern (e.g. cold or hot access tire) you're using.
- How much of your storage account allotment you're using to store data. How many copies of your data are maintained at one time, and in what locations?
- You also get charged for the amount of read and write operations performed and for any data transfer activities.
- You will incur a cost when you transfer data between Azure services located in different regions.
- When the data in your storage account is accessed by an application that isn't running in the same region, you're charged for data egress.
Summary
I hope you understood some of the core concepts of Azure Storage account service. It's always recommended to check
Microsoft documentation for the latest modification of storage account services. In the next blog, we will go deep into accessing various storage services from .NET Core applications.