azure blob_不同的Azure存储类型(文件,Blob,队列和表)

azure blob

There are several advantages to using Azure storage irrespective of type. Azure storage is easily scalable, extremely flexible and relatively low in cost depending on the options you choose.

无论类型如何,使用Azure存储都有很多优点。 根据您选择的选项,Azure存储易于扩展,非常灵活并且成本相对较低。

There are 4 types of storage in Azure, namely:

Azure中有四种存储类型,即:

  • File

    文件
  • Blob

    斑点
  • Queue

    队列
  • Table

For the traditional DBA, this might be a little confusing. In this article, I will explain the different types of storage and when each of them should be used.

对于传统的DBA,这可能会有些混乱。 在本文中,我将解释不同的存储类型以及何时使用它们。

磁盘类型 (Disk Types)

Azure offers 2 types of disk storage:

Azure提供了两种类型的磁盘存储:

  • Managed

    Managed disk has some advantages over unmanaged disks in the sense that disks will be created and managed for you. This is a IaaS offering.

    管理

    在将为您创建和管理磁盘的意义上,托管磁盘相对于非托管磁盘具有一些优势。 这是IaaS产品。

  • Unmanaged

    With unmanaged disks, you must manage it yourself. Basically, this means that your virtual hard disks are stored in a storage account as page blobs.

    不受管理

    对于非托管磁盘,您必须自己进行管理。 基本上,这意味着您的虚拟硬盘作为页面Blob存储在存储帐户中。

And two types of disks:

还有两种类型的磁盘:

  • Premium

    Which means your data will be placed on solid state disks

    保费

    这意味着您的数据将被放置在固态磁盘上

  • Standard

    Where data is placed on regular hard disk drives

    标准

    数据放置在常规硬盘驱动器上的位置

As shown below, you choose the type of disks you want by selecting either Standard or Premium when creating your storage account.

如下所示,通过在创建存储帐户时选择“标准”或“高级”来选择所需的磁盘类型。

如何创建存储帐户 (How to create a storage account)

In the Azure portal ➜ click on Storage Accounts ➜ then on Add

在Azure门户中➜单击“存储帐户”➜然后单击“添加”

azure blob_不同的Azure存储类型(文件,Blob,队列和表)

Fill in all required fields and choose the relevant options:

填写所有必填字段,然后选择相关选项:

azure blob_不同的Azure存储类型(文件,Blob,队列和表)
  • Name

    The name of your account.

    名称

    您的帐户名称。

  • Deployment Model

    If you have legacy programs which might access this account, choose classic. For the purpose of this article we will use resource manager.

    部署模型

    如果您有可以访问此帐户的旧程序,请选择经典。 就本文而言,我们将使用资源管理器。

  • Account Kind

    There are 2 kinds of accounts: General purpose accounts which you can use for any storage type, including blobs, and blob accounts which are specifically for blobs. Unlike the general storage account, you can set hot or cold service tiers for blob storage.

    帐户种类

    有2种帐户:可以用于任何存储类型(包括blob)的通用帐户,以及专门用于blob的blob帐户。 与常规存储帐户不同,您可以为Blob存储设置热或冷服务层。

  • Performance

    Depending on what you want to do with the storage, you can choose Standard which is on HDD or Premium which is on SSD. Obviously, the latter incurs a higher cost than the former.

    性能

    根据您要使用的存储方式,可以选择HDD上的Standard或SSD上的Premium。 显然,后者的成本要高于前者。

  • Replication

    This has to do with how redundant you want your data to be. For the purpose of this article I am using locally redundant storage. This topic is however beyond the scope of the article, but you can read more about storage redundancy in this link.

    复写

    这与希望数据有多冗余有关。 就本文而言,我正在使用本地冗余存储。 但是,该主题超出了本文的范围,但是您可以在此链接中阅读有关存储冗余的更多信息。

  • Encryption

    This allows for your data to be either encrypted or not. Encryption is always a good policy, but in this case I will go without.

    azure blob_不同的Azure存储类型(文件,Blob,队列和表)

    Figure 3: Create storage account continued

    加密

    这样可以对您的数据进行加密或不加密。 加密始终是一个很好的策略,但是在这种情况下,我会避免使用。

    图3:继续创建存储帐户

  • Subscription

    Your subscription name.

    订阅

    您的订阅名称。

  • Resource group

    You can create either a new resource group or reuse an existing one.

    资源组

    您可以创建一个新的资源组,也可以重用现有的资源组。

  • Location

    In which region, would you prefer your data to be?

    位置

    您希望数据在哪个区域?

The click on Create. And you are all set.

单击创建。 你们都准备好了。

斑点存储 (Blob Storage)

The word blob is an acronym which stands for binary large object. Blobs typically include large files that are unstructured, such as images, video, music files, backup files etc.

Blob是一个缩写词,代表二进制大对象。 Blob通常包括大型非结构化文件,例如图像,视频,音乐文件,备份文件等。

Blob storage can be divided into two access tiers, a hot access tier for data which is accessed frequently and a cold access tier for data which is not accessed very often.

Blob存储可以分为两个访问层,一个是频繁访问的数据的热访问层,另一个是不经常访问的数据的冷访问层。

The cold access tier is cheaper than the hot access tier and as such you can store more data at a lower cost, it is also slightly less available, like 99% as opposed to the 99.9% of the hot storage tier.

冷访问层比热访问层便宜,因此,您可以以较低的成本存储更多数据,可用性也略低,例如99%而不是热存储层的99.9%。

It’s also possible to switch between access tiers at any point if you wish to do so.

如果您愿意,也可以随时在访问层之间进行切换。

There are essentially 3 different types of blobs (in a nutshell):

基本上有3种不同类型的Blob(概括地说):

  • Block blobs

    As suggested by the name, block blobs are made of blocks. Each block has a block ID. Blocks can be different sizes, potentially up to a maximum of 4.75TB. Block clients are set to 32MB size block by default, but this can be configured using the SingleBlobUploadThresholdInBytes property.

    Block blobs are optimized for data streaming, and has some features which helps you to manage blobs such as an MD5 hash for verification or parallel uploads.

    阻止斑点

    顾名思义,块Blob由块组成。 每个块都有一个块ID。 块的大小可以不同,最大可能达到4.75TB。 默认情况下,块客户端设置为32MB大小的块,但是可以使用SingleBlobUploadThresholdInBytes属性进行配置。

    块Blob已针对数据流进行了优化,并具有一些有助于您管理Blob的功能,例如用于验证或并行上传的MD5哈希。

  • Append blobs

    Append blobs are used to append data. Basically, this means that each time you make changes to the blob, the data will be appended at the end of the blob. Data cannot be changed or deleted, only appended.

    附加斑点

    附加blob用于附加数据。 基本上,这意味着每次您对Blob进行更改时,数据都会附加在Blob的末尾。 不能更改或删除数据,只能附加。

  • Page blobs

    A page blob consists out of pages. A page is 512 bytes, and the blob can go up to 1 TB in size.

    This is typically used for fast read and write operations.

    页面斑点

    页面Blob由页面组成。 页面为512字节,并且Blob的大小最多可以达到1 TB。

    通常用于快速读写操作。

You must choose the type of blob when you create the blob and unfortunately once the blob is created it’s not possible to change it to a different type.

创建blob时,必须选择blob的类型,但是不幸的是,一旦创建了blob,就无法将其更改为其他类型。

创建一个存储块 (Create a storage blob)

Click on the storage account and the select Blobs as the type of service you want.

单击存储帐户,然后选择Blob作为所需的服务类型。

azure blob_不同的Azure存储类型(文件,Blob,队列和表)

On the Blob service screen:

在Blob服务屏幕上:

  • Click on + Container

    点击+容器

Then enter the:

然后输入:

  • Name

    The name of the blob

    名称

    斑点的名称

  • Access Type

    There are 3 possible access types:

    • Private

      This is the default. Data is only available to the account owner.

    • Blob

      This enables read access publicly.

    • Container

      Allows list and read access to the entire container.

    访问类型

    有3种可能的访问类型:

    • 私人的

      这是默认值。 数据仅对帐户所有者可用。

    • 斑点

      这样可以公开进行读取访问。

    • 容器

      允许对整个容器进行列表和读取访问。

azure blob_不同的Azure存储类型(文件,Blob,队列和表)

队列存储 (Queue Storage)

Queue Storage is somewhat like MSMQ. It allows you to decouple your components and have reliable asynchronous communication. In Azure Queue Storage, the number of queues is only limited by the capacity of the storage account.

队列存储有点像MSMQ。 它允许您解耦组件并进行可靠的异步通信。 在Azure队列存储中,队列数仅受存储帐户的容量限制。

Queues and messages can be created programmatically or using the Storage Explorer tool.

队列和消息可以以编程方式或使用Storage Explorer工具创建。

Queue storage consists out of the following components:

队列存储由以下组件组成:

  • Account

    This is your Azure Storage account which contains your queue storage.

    帐户

    这是包含队列存储的Azure存储帐户。

  • Queue

    These are groups of messages; you can create multiple queues for different purposes. Queue names must be in lowercase.

    队列

    这些是消息组; 您可以为不同的目的创建多个队列。 队列名称必须小写。

  • Message

    This is a message placed in the queue to be processed. A message can be up to 64KB each.

    信息

    这是放置在要处理的队列中的消息。 每条消息最大为64KB。

azure blob_不同的Azure存储类型(文件,Blob,队列和表)

表存储 (Table Storage)

Table storage is used to store semi-structured data in a key-value format in a NoSQL datastore. Azure table storage can store petabytes of data, can scale and is inexpensive. Table storage can be accessed using REST and some of the OData protocols or using the Storage Explorer tool.

表存储用于在NoSQL数据存储中以键值格式存储半结构化数据。 Azure表存储可以存储PB的数据,可以扩展并且价格便宜。 可以使用REST和某些OData协议或使用Storage Explorer工具访问表存储。

Table storage has the following components:

表存储具有以下组件:

  • Account

    This is the storage account where you wish to save your tables.

    帐户

    这是您要保存表的存储帐户。

  • Table

    This is not a traditional table in the sense of a transactional database, this is rather a schema-less collection of entities. Table names must be unique in your account and cannot be more than 63 characters.

    从事务数据库的角度来看,这不是传统的表,而是实体的无模式集合。 表名在您的帐户中必须唯一,并且不能超过63个字符。

  • Entity

    An object which consists out of properties. Each entity has a partition key, a row key and a timestamp by default. An entity can store 252 properties. An entity can have a maximum size of 1MB.

    实体

    由属性组成的对象。 每个实体默认都有一个分区键,一个行键和一个时间戳。 一个实体可以存储252个属性。 实体的最大大小为1MB。

  • Properties

    The properties are the key-value pairs. A property name must not be longer than 255 characters and is case sensitive.

    物产

    这些属性是键值对。 属性名称不得超过255个字符,并且区分大小写。

The following types are supported for properties:

属性支持以下类型:

Common Language Runtime type
Byte[]
Bool
DateTimr
Double
Guid
Int32 or int
Int64 or long
String
公共语言运行时类型
字节[]
布尔
DateTimr
引导
Int32或int
Int64或更长

档案储存 (File Storage)

Azure file storage makes it easy to move applications which depend on regular file shares to the cloud. File storage uses the SMB 2.1 or 3.0 protocol and can be accessed by multiple applications simultaneously. There are some SMB features which are not currently supported. For a complete list, see this link.

利用Azure文件存储,可以轻松地将依赖于常规文件共享的应用程序移动到云中。 文件存储使用SMB 2.1或3.0协议,并且可以由多个应用程序同时访问。 目前尚不支持某些SMB功能。 有关完整列表,请参见此链接

File storage encompasses 4 component types:

文件存储包括4种组件类型:

  • Account

    This is your Azure storage account, in which you created your main file share.

    帐户

    这是您在其中创建主文件共享的Azure存储帐户。

  • Share

    File shares created in the main file share. Share names can be 63 characters long.

    分享

    在主文件共享中创建的文件共享。 共享名称可以是63个字符长。

  • Directory

    Any hierarchy of folders and directories. Directory names can be up to 255 characters long.

    目录

    文件夹和目录的任何层次结构。 目录名称最多可包含255个字符。

  • Files

    Any files uploaded to the share, to a maximum size of 1 TB.

    档案

    任何上传到共享的文件,最大大小为1 TB。

创建文件共享 (Create a file share)

To create a file share, click on your storage account and select Files as the type of service you want.

要创建文件共享,请单击您的存储帐户,然后选择“文件”作为所需的服务类型。

On the File service screen:

在文件服务屏幕上:

  • Click on + File share

    点击+文件共享

Then enter the:

然后输入:

  • Name

    The name you want to give the file share

    名称

    您要提供文件共享的名称

  • Quota

    The quote you want to allocate to the file share. This can be anywhere from 1 GB to approximately 5 TB.

    配额

    您要分配给文件共享的报价。 范围从1 GB到大约5 TB。

  • Click on OK.

    单击确定。

azure blob_不同的Azure存储类型(文件,Blob,队列和表)

You can then proceed to click on the file share and create directories or add files just as you would with a normal file share.

然后,您可以继续单击文件共享并创建目录或添加文件,就像使用普通文件共享一样。

Storage Explorer工具 (Storage Explorer Tool)

To manage the objects on your storage you can use the free Storage Explorer tool. Since this tool is open source, you can also download the source code for it. This tool is currently still in preview and new features are added on a regular basis.

要管理存储中的对象,可以使用免费的Storage Explorer工具 。 由于此工具是开源的,因此您也可以下载它的源代码。 该工具目前仍处于预览状态,并且会定期添加新功能。

But I find it quite useful since when you are logged into your Azure account, it shows almost all information regarding the account, including the primary and secondary connection strings for each of your storage accounts.

但是我发现它非常有用,因为当您登录到Azure帐户时,它几乎显示了有关该帐户的所有信息,包括每个存储帐户的主要和辅助连接字符串。

It also allows you to create tables and queues which you cannot do directly in the Azure Portal.

它还允许您创建表和队列,而这些表和队列不能直接在Azure门户中执行。

azure blob_不同的Azure存储类型(文件,Blob,队列和表)

翻译自: https://www.sqlshack.com/different-azure-storage-types-file-blob-queue-table/

azure blob