locked
Retrieve table data query performance in Azure table storage? RRS feed

  • Question

  • Hello Eveyone

    I use to store my session in Azure Table Storage, in that there is a Row key inserted as Empty string & Partition key inserted as .NET Session Id & I use to retrieve data by "c.PartitionKey == sessionId && c.RowKey == String.Empty".

    I would like to know that If i store session id as row key & partition key as uniqueId, and i retrieve query by Rowkey should it increase my query performance??

    Thanks in Advance


    Manish K. Bhalodi

    Tuesday, August 26, 2014 2:24 PM

Answers

  • Hi,

    There are a number of good practices to follow when designing entities to get the best performance with your Azure Table Storage. However In this blog I would like to share my best practice as described below:

    Query tables using both Partition and Row Key to achieve best performance   with Windows Azure Table Storage.

    In Windows Azure Tables, the string PartitionKey and RowKey properties work together as an index for your table. So when using Partition and Row Keys, the storage will use its index to find results really fast, while when using other entity properties the storage will result in table scan, significantly reducing performance. So from performance perspective, querying on the Partition Key is good, querying on both Partition and Row Key is better, querying only on Row Key is not good (will result in table scans).

    Please refer the following links :

    http://codebetter.com/dariosolera/2011/10/14/azure-table-storage-performace-considerations/

    http://blogs.msdn.com/b/wats/archive/2013/02/19/improving-windows-azure-table-storage-query-performance.aspx

    Regards,

    Bharath

    • Marked as answer by Manish082007 Wednesday, August 27, 2014 4:40 AM
    Tuesday, August 26, 2014 3:56 PM

All replies

  • Hi,

    There are a number of good practices to follow when designing entities to get the best performance with your Azure Table Storage. However In this blog I would like to share my best practice as described below:

    Query tables using both Partition and Row Key to achieve best performance   with Windows Azure Table Storage.

    In Windows Azure Tables, the string PartitionKey and RowKey properties work together as an index for your table. So when using Partition and Row Keys, the storage will use its index to find results really fast, while when using other entity properties the storage will result in table scan, significantly reducing performance. So from performance perspective, querying on the Partition Key is good, querying on both Partition and Row Key is better, querying only on Row Key is not good (will result in table scans).

    Please refer the following links :

    http://codebetter.com/dariosolera/2011/10/14/azure-table-storage-performace-considerations/

    http://blogs.msdn.com/b/wats/archive/2013/02/19/improving-windows-azure-table-storage-query-performance.aspx

    Regards,

    Bharath

    • Marked as answer by Manish082007 Wednesday, August 27, 2014 4:40 AM
    Tuesday, August 26, 2014 3:56 PM
  • Hi Manish,

    As far as I know, we have three available modes to store session value when we develop .NET application in azure, 1) using Azure Table Storage, 2) using SQL Azure, 3) using Azure cache. the first option is cheaper, however it is still not an ideal place to store ASP.NET Session State primarily because of performance as it is file based. If you want to get better performance, I suggest use the third option, Windows Azure Caching is probably the most preferable option available today. It provides a high-performance, in-memory, distributed caching service.

    Best Regards,

    Jambor


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, August 27, 2014 3:30 AM
  • Hi Jambor

    Yes, You are totally right, but our company doesn't use Azure cache, so company prefer Azure Table so we have to work with same :)


    Manish K. Bhalodi

    Wednesday, August 27, 2014 4:43 AM
  • Thank You Bharath for your quick answer...

    Manish K. Bhalodi

    Wednesday, August 27, 2014 4:47 AM