locked
Purpose of Partition Key in Azure Table Storage RRS feed

  • Question

  • What is the advantage of having Partition Keys in Windows Azure Table Storage ?
    Friday, October 15, 2010 4:21 AM

Answers

  • The PartitionKey supports scalability of Azure Tables. Entities with the same PartitionKey comprise a partition and are stored together and handled by the same partition server. The Azure Storage Service can move partitions to different partition servers if it detects that a particular partition server is getting hot, i.e. too much traffic. The allocation of PartitionKeys should be predicated on the scalability needs of the application.

    The RowKey guarantees uniqueness within a partition so together the PartitionKey and RowKey serve as the primary key for an Azure table.

    • Marked as answer by Mog Liang Friday, October 22, 2010 8:25 AM
    Friday, October 15, 2010 4:35 AM
    Answerer
  • Adding what Neil mentioned.

    Azure Tables Storage does provide ability to load balance across storage nodes whenever a server faces high-traffic. However, do note that we don't have control to say I want to keep record #1 - 10000 to server A, move record #10001 to 30000 to server B, etc. Windows Azure doesn't allow you doing so.

    You may refer to http://msdn.microsoft.com/en-us/library/dd179338.aspx for more detail about the Azure Table Storage.

    As a solution, you can specify a "partition key" to keep a group of entities stay together whenever partition occurs. Thus, partition key must be appropriately chosen to ensure performance as well as correctness. I suggest you to watch this great video http://www.msdev.com/Directory/Description.aspx?eventId=1783 to see how Azure table storage is optimized.


    regards, wely
    • Marked as answer by Mog Liang Friday, October 22, 2010 8:25 AM
    Friday, October 15, 2010 2:41 PM

All replies

  • The PartitionKey supports scalability of Azure Tables. Entities with the same PartitionKey comprise a partition and are stored together and handled by the same partition server. The Azure Storage Service can move partitions to different partition servers if it detects that a particular partition server is getting hot, i.e. too much traffic. The allocation of PartitionKeys should be predicated on the scalability needs of the application.

    The RowKey guarantees uniqueness within a partition so together the PartitionKey and RowKey serve as the primary key for an Azure table.

    • Marked as answer by Mog Liang Friday, October 22, 2010 8:25 AM
    Friday, October 15, 2010 4:35 AM
    Answerer
  • Adding what Neil mentioned.

    Azure Tables Storage does provide ability to load balance across storage nodes whenever a server faces high-traffic. However, do note that we don't have control to say I want to keep record #1 - 10000 to server A, move record #10001 to 30000 to server B, etc. Windows Azure doesn't allow you doing so.

    You may refer to http://msdn.microsoft.com/en-us/library/dd179338.aspx for more detail about the Azure Table Storage.

    As a solution, you can specify a "partition key" to keep a group of entities stay together whenever partition occurs. Thus, partition key must be appropriately chosen to ensure performance as well as correctness. I suggest you to watch this great video http://www.msdev.com/Directory/Description.aspx?eventId=1783 to see how Azure table storage is optimized.


    regards, wely
    • Marked as answer by Mog Liang Friday, October 22, 2010 8:25 AM
    Friday, October 15, 2010 2:41 PM