本文介绍了Windows Azure中的存储。说到大存储,有一些事情需要了解。Windows Azure提供范围广泛的存储服务,支持几乎所有类型的存储需求,从结构化数据到非结构化数据、NoSQL数据库和队列。
数据如何存储在云端
就Windows Azure而言,它有四种存储形式,它们是:
- Blob 存储
- 队列存储
- 表存储
- Windows Azure 驱动器
让我们尝试对它们中的每一个进行通用解释!
Blob 存储
Blob是二进制大(Binary Large)对象的首字母缩写词。基本上 Blob(Basically Blob)是一个字节序列——正是应用程序所需要的。Blob可以以非常通用的方式保存音频、视频、电子邮件、存档文件、zip 文件或文字处理文档。
要使用 blob,开发人员首先在某个存储帐户中创建一个或多个容器。然后,这些容器中的每一个都可以容纳一个或多个 blob。有两种类型的 Blob 存储可用,每种都提供特定的功能:
- 块块
- 页面 Blob
Blob(Blobs)存储在Blob Containers中并在其范围内。每个 blob 最大可达 50GB。Blob 在容器中具有唯一的字符串名称。Blob(Blobs)可以具有与之关联的元数据,这些元数据是对,每个 blob 的大小最大为 8KB。Blob 元数据可以与 Blob 数据位分开设置。
队列存储
队列的主要目标是允许Windows Azure应用程序的不同部分之间进行通信。简而言之,队列(Queues)将Web 角色(Web Role)实例和工作角色实例(Worker Role Instances)分开– 一个队列包含许多消息 – 队列名称由帐户限定。
- 队列中存储的消息数量没有限制。
- 一条消息最多存储一周。系统将垃圾收集超过一周的消息。
队列可以有与之关联的元数据。元数据(Metadata)的形式为对,每个队列的大小最大为 8KB。 - 传统的队列可以提供“先进先出”的语义;另一方面,Windows Azure中的队列不保证一条消息可以多次传递。
处理来自队列的消息是一个两阶段的过程,其中包括获取消息,然后在处理完消息后将其删除。这种模式保证了成功的消息传递。
表存储
表存储是行状实体的集合,每个实体最多可以包含 255 个属性;但是,与数据库中的表不同,没有模式可以对表中的所有行强制执行一组特定的值。表存储由需要存储大量需要额外结构的数据存储的应用程序使用。
虽然表存储结构化数据,但它不提供任何方式来表示数据之间的关系,有时称为NoSQL数据库。Windows Azure中的表为可扩展性打开了空间。开发人员设计可扩展的应用程序是有意义的。只需(Just)设计一个表并添加一些实体,然后Windows Azure会处理其余的事情。
这里的目标是帮助开发人员专注于他们的应用程序开发,而不是担心大数据管理。
Understanding Blob, Queue, Table storage in Windows Azure
This article throws light on storage in Windows Azure. When it comes to the large ѕtorage, therе are certain things that need to be undеrstood. Windows Azure offеrs a wide range of storage services supporting virtually all types of storage needs, from structured to unstructυred dаta, NoSQL databases, and queues.
How is data stored in the Cloud
As far as Windows Azure goes it has four forms of storage and they are:
- Blob storage
- Queue storage
- Table storage
- Windows Azure drive
Let us try to get a generic explanation for each of them!
Blob Storage
Blob is an acronym for Binary Large object. Basically Blob is a sequence of bytes – just what an application needs. Blob can hold audio, video, email messages, archived files, zip files or a word processing document in a very general way.
To use blobs, a developer first creates one or more containers in some storage account. Each of these containers can then hold one or more blobs. There are two types of blob storage available, each provides specific functionality:
- Block Blob
- Page Blob
Blobs are stored in and scoped by Blob Containers. Each blob can be up to 50GB. A blob has a unique string name within the container. Blobs can have metadata associated with them, which are <name, value> pairs and they are up to 8KB in size per blob. The blob metadata can be set separately from the blob data bits.
Queue storage
The main goal of queues is to allow communication between different parts of a Windows Azure application. In simple words Queues separate Web Role instances and Worker Role Instances – A queue contains many messages – The queue name is scoped by the account.
- There is no limit on the number of messages stored in a queue.
- A message is stored for at most a week. The system will garbage collect the messages that are more than a week old.
Queues can have metadata associated with them. Metadata is in the form of <name, value> pairs, and they are up to 8KB in size per queue. - A conventional queue may offer semantics of ‘first in first out’; on the other hand queues in Windows Azure don’t guarantee that a single message can be delivered multiple times.
Processing messages from a queue is a two-stage process, which involves getting the message, and then delete the message after it has been processed. This pattern guarantees successful message delivery.
Table Storage
Table storage is a collection of row-like entities, each of which can contain up to 255 properties; however, unlike tables in a database, there is no schema that enforces a certain set of values on all the rows within a table. Table Storage is used by applications requiring storing large amounts of data storage that need additional structure.
While table stores structured data, it does not provide any way to represent relationships between the data, sometimes called a NoSQL database. Tables in Windows Azure open up room for scalability. It makes sense for developers to design scalable applications. Just design a table and add some entities then Windows Azure takes care of the rest.
The goal here is to help developers to focus on their application development rather than worrying about large data management.