Q62. Azure Storage Partitions?

When we talk of a Storage account, the concept of partition should also be understood. Every object we store in the Storage account has a partition key.

As discussed earlier, an object can be stored as a blob, table entity or a queue message. Partition key is used to access an object in a storage account. However, the definition of a partition key varies depending on the type of the object.

If the object is a blob, then the partition key constitutes the Container Name and the BlobName. If the object is an entity in a table, then the partition key constitutes the TableName and Partition Key. If an object is a message in a queue, then the partition key is Queue Name.

The partition determines how Windows Azure storage load balances blobs, messages, and entities across servers to meet the traffic needs of these objects. The partition key is unique within the storage account and is used to locate a blob, message, or entity.

In the previous question we have seen the performance targets of a single partition for each of the storage service.

  • For a single Blob: throughput is up to 60 MBytes/sec.
  • A single Queue can process 2000 messages per second.
  • A single table partition can throughput upto 2000 entities per second. This works out to 20,000 entities per second assuming there are no objects other than table and there is only a single partition.

As a developer we do not have any control over partitioning of Blobs. Azure manages it automatically. By default, a single blob becomes a single partition, a single queue becomes a single partition.

Whereas developers have control over partitioning of table by specifying Partition key of thier choice and can spread these partitions across several nodes. If the partition key is not specified, a table will have a single partition.