- 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.
- 中文版AutoCAD 2016從入門到精通
- Photoshop CS6 商業應用案例實戰
- 中文版After Effects 2021入門教程
- Blender 3D Architecture, Buildings, and Scenery
- Photoshop CC從入門到精通(全彩超值版)
- Illustrator 2024從入門到精通
- SPSS統計分析
- UG NX 9中文版從入門到精通
- Vue 企業開發實戰
- Indesign平面排版技術應用
- Adobe創意大學InDesign CS5 產品專家認證標準教材
- 好用,Excel數據處理高手
- 中文版Photoshop平面設計入門教程
- Quality Assurance for Dynamics AX-Based ERP Solutions
- Illustrator 2024實用教程