- Microsoft Windows Azure Development Cookbook
- Neil Mackenzie
- 797字
- 2021-04-02 18:51:57
Introduction
The Windows Azure Blob Service is the Windows Azure Storage Service feature that manages the storage of file-based entities referred to as blobs. In this chapter, we will focus on the Blob service. In the next two chapters, we will look at the other storage services: the Table service and the Queue service.
The definitive way to access the storage service is through the Windows Azure Storage Service REST API. The Windows Azure Storage Client library is a high-level managed library, included in the Windows Azure SDK, which abstracts the RESTful interface into a set of classes. The Windows Azure Storage Client Protocol classes contained in the Storage Client library expose functionality not provided in the core library classes. Specifically, the protocol classes provide access to the underlying HttpWebRequest
object used to invoke the RESTful operations.
Nearly all the recipes in this chapter use the Storage Client library. Scattered through the recipes are examples of how to use it for basic operations, such as creating a container and uploading blobs. However, we use the RESTful interface in the Copying a blob with the Windows Azure Storage Service REST API recipe. It is worthwhile to have some knowledge of the Storage Service REST API because it is informative to look at the raw REST operations sent over the wire to the storage service when debugging problems with storage operations. We use the Protocol classes in the Leasing a blob using the Protocol classes in the Windows Azure Storage Client Library recipe.
There are two types of blob: block blobs optimized for streaming and page blobs optimized for random access. In the Uploading blocks to a block blob recipe, we see how to increase control over the uploading of a block blob by uploading individual blocks and then committing them to create the block blob. In the Uploading a VHD into a page blob recipe, we see how to improve the upload performance by uploading only non-empty pages. The primary use case for page blobs is the storage of VHDs, which can then be attached as an Azure Drive to a role instance.
Blobs can have both properties and metadata associated with them. The properties comprise standard HTTP header fields that provide additional information to clients downloading the blobs. The metadata comprises a sequence of arbitrary name-value pairs. In the Setting properties and metadata for a blob recipe, we see how to use properties and metadata.
The Blob service supports the creation of a blob snapshot to provide a read-only version of the content of a blob when the snapshot is created. A blob can be rolled-back to an earlier state by copying the snapshot over it. An important use case for a snapshot is when its base blob is a VHD page blob. A writable VHD page blob can be attached as an Azure Drive to only one instance at a time. However, a read-only VHD blob snapshot can be attached simultaneously to an unlimited number of instances. The Creating and using a blob snapshot recipe shows us blob snapshots in action.
The Blob service stores blobs in a simple two-level hierarchy of containers and blobs. In the Using blob directories recipe we use the directory support provided by the Blob service to simulate a more complex hierarchy mimicking directories in a file system. In the Creating and using the root container for blobs recipe we see how to create a root directory that allows blobs to appear to be located at the root of the hierarchy and not inside a container. This allows cross-domain policy files to be stored as blobs.
The Storage Client library provides both synchronous and asynchronous versions of almost all methods that access the storage service. The asynchronous methods adhere to the common language runtime Asynchronous Programming Model (APM). In the Downloading a blob asynchronously recipe, we see how easy it is to use the asynchronous methods to download a blob. In the Optimizing blob uploads and downloads recipe, we see how to use the Task Parallel library provided in .NET Framework 4 to improve the performance of blob uploads and downloads by performing operations in parallel.
A storage operation against the storage service may fail for various reasons. Consequently, the Storage Client library provides built-in support for retries of failed operations. In the Using retry policies with blob operations recipe, we see how to parameterize existing retry behavior and implement custom retry functionality.
The Windows Azure Content Delivery Network (CDN) can be used to cache blobs closer to the user. This significantly improves the download performance of blobs. In the Using the Windows Azure Content-Delivery Network (CDN) recipe, we see how to use the CDN. We also see how to configure custom domains for both the Blob service and the CDN.
- PrestaShop 1.3 Theming – Beginner’s Guide
- 創意UI:Photoshop玩轉移動UI設計
- Entity Framework Tutorial
- AutoCAD 2019中文版從入門到精通
- ImageMagick Tricks
- Django 1.0 Website Development
- 通達信炒股軟件從入門到精通(第2版)
- Oracle Enterprise Manager Grid Control 11g R1: Business Service Management
- AutoCAD 2016入門與提高(超值版)
- 人人都能玩賺AI繪畫
- WCF Multi/tier Services Development with LINQ
- 零基礎學Premiere Pro短視頻制作
- 中文版Photoshop CC基礎教程
- 魔法詞典:AI繪畫關鍵詞圖鑒(Midjourney版)
- Apache CXF Web Service Development