You likely chose Microsoft Azure because of its flexibility. The ability to access it from any device and ramp up — or down — with ease is attractive to organizations seeking greater agility. You may also enjoy the cost certainty of working with a managed hosting provider. But do you still struggle with knowing how and where to store all your data?
Help is here in the following Microsoft Azure storage best practices. The best practices we recommend focus primarily on Blob storage, because that’s what many businesses use most often. However, we have also included Azure Table, Queues, and File storage best practices to help you cover all the bases.
First Things First: What You Need to Know About Azure Storage
There are a few Microsoft Azure storage best practices to implement before you begin to store data:
- Keep your performance targets and types of storage in mind
- Determine naming conventions so you can easily find your data later
- Remember to tag so you can clearly organize your resources
- Be aware that each storage account has a limit of 500 terabytes
- Understand it’s a shared resource, so where you store critical data matters
Understand Blob Storage Types
There are two types of Blobs, and here’s where Microsoft terminology becomes important because it’s a bit counterintuitive.
- Block Blobs: These are object storage Blobs, and they have a limit of 200 gigabytes. You’ll typically use these for persistent data. Block Blobs are meant for sequential file read and are best for unstructured data that doesn’t change often. Consider using Block Blobs for documents, music, videos and photos, backups, images, text for web applications, Cloud application configuration data, and large datasets like logs.
- Page Blobs: This disk-like block storage is most often used for sparse files you’ve optimized for random reads and writes. Page Blobs are comprised of 512-byte pages with a maximum size of 1 terabyte.
Create Containers in Azure
Both types of Blobs are stored in Azure in containers, which you should create ahead of time whenever you can to save on transaction costs. Azure storage best practices to note when creating containers include:
- Stick to your predetermined naming conventions
- Set the access type
- Find — and manage — your account access key
- Set the metadata
If you’re using .NET, use the Azure Storage Client SDK to make organizing your containers and Blobs a bit easier.
Upload and Store Your Blobs in 4 Steps
- Once you have an active Azure subscription, set up a storage account.
- Adam Bertram, expert in IT automation and all things Microsoft, suggests your next step is to “install the Azure PowerShell module and download the Copy-AzureItem script,” making sure to dot source and make it available in the PowerShell session.
- Then use Add-AzureRmAccount cmdlet to connect to your storage account. Find the Blob you want to upload and use the Get-AzureRmStorageAccount cmdlet to copy the file name to the account.
- Finally, use Get-AzureStorageContainer cmdlet to choose which container to store the file in.
This training video from Microsoft’s Virtual Academy demos how to get your Blobs into Azure. It outlines the following Azure storage best practices for both block and page Blobs:
Blob Storage Best Practices
Block Blobs | Page Blobs |
Create a storage account object from the app config | Create a container |
Create a Blob client | Create Page Blob |
Get a reference to a container, which is similar to a director; create and upload it | Write to page Blob |
Upload the block Blob asynchronously with a single API call | List Blobs in a container |
List the Blobs in a container and download them (also single calls) |
Don’t Underestimate the Importance of File Naming
We can’t stress enough how important it is to create a clear and consistent file naming system within your Blob storage. This is because Azure storage isn’t hierarchical beyond containers. Additionally, if you decide later to move to a different platform, you might need to change your app code.
Other Microsoft Azure storage best practices for Blob storage include:
Best Practices for Azure Table Storage
As the name implies, table storage in Microsoft Azure is best for tabulated data, and it needs to be designed for scalability, query performance, and availability. Keep in mind that there is limited transaction support, and no support for relationships or secondary indexes in Azure table storage.
That said, if you do use table storage, be sure to apply the following Azure storage best practices:
- Use Upserts, Merge, Projection, and Point Queries. This will help minimize the number of requests and volume of data traveling over the network.
- For big datasets, consider locality and computation. Bring the compute to the data by using Hadoop or Service Fabric to enhance I/O access times.
- Use partitioning to improve scalability, reduce contention, and optimize performance. Another benefit of partitioning is that it can provide a mechanism for dividing data by the pattern of use. For example, you can archive older, less active (cold) data in cheaper data storage.
- Pay attention to the PartionKey and batch entities. It is best to update them together.
- Determine your partitioning strategy. Whether you use horizontal, vertical, or functional partitioning, or a combination of the three, your decision will influence performance.
How to Use Azure Storage Queues
Azure Storage Queues are a messaging communication mechanism that lets you reliably pass messages to and from a single application’s different components, or the components of multiple applications.
Queues separate Web Role instances and Worker Role instances. They’re a REST-based service for storing messages that can be accessed and consumed from anywhere via authorized HTTP or HTTPS requests. It’s a ready-to-use service that loosely connects components or applications through the Cloud.
Queue storage is very limited in message size, so it’s best used to describe a task and link to stored data. Alexandre Brisebois, an Azure expert, offers six tips for queue storage. He emphasizes the importance of making the message process idempotent so it doesn’t get processed more than once, and using Dequeue Count to distinguish poison messages.
Best Practices for File Storage
Azure File Service is more expensive than Blob storage but can be used for legacy applications. It uses the standard Server Message Block Protocol.
To follow Azure storage best practices for Azure Files, it’s best to limit their use to:
- Lifting and shifting to the Cloud applications that already use native file system APIs to share data between pieces of the applications.
- Storing development and debugging tools that need to be accessed from many Cloud instances.
- Applications that want REST access to data from anywhere, and SMB access to data from within the region where the storage account is located.
Carry Out Azure Storage Best Practices Today
At Data Resolution, we manage and optimize all aspects of Azure Cloud services for a range of organizations and IT teams. If you’re interested in learning how we can support your Azure Cloud deployment, contact us today to speak with an Azure expert.
No comments:
Post a Comment