2

Azure Storage Tables have been superseeded by Azure Cosmos Table API at a significantly higher price point but also with new features like automatic secondary indexing.

One of the pain points using Azure Storage Tables was, that in order to achieve custom ordering of query, we have to redundantly store the data with different Partition/Row-Keys as the documentation states, that

Query results returned by the Table service are sorted in ascending order based on PartitionKey and then by RowKey.

However, the next paragraph states, that

Query results returned by the Azure Table API in Azure DB are not sorted by partition key or row key. For a detailed list of feature differences, see differences between Table API in Azure Cosmos DB and Azure Table storage.

Following, the link, i find that

Query results returned by the Table API aren't sorted in partition key/row key order as they're in Azure Table storage.

So i am a bit confused now, how to achieve ordering when using Cosmos Table API. Is there no ordering at all? Or can i specify ordering with my querys?

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60
Markus S.
  • 2,602
  • 13
  • 44

2 Answers2

2

For Azure Cosmos Table API, this one is correct: "Query results returned by the Azure Table API in Azure DB are not sorted by partition key or row key".

So the returned results is no sorting as of now.

Somebody has asked this issue before at GitHub here.

And the MS team suggests vote on this user voice. And they may add this basic sort feature in future.

Hope it helps.

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60
  • Thank you for the link! So in fact, if i need sorted data there is no way to achieve this with Cosmos DB Table API, making it intrinsically unsuitable for time series data, right? – Markus S. Mar 04 '19 at 13:38
  • 1
    @MarkusS., yes, you are right. Maybe it will be added in the future release. – Ivan Glasenberg Mar 06 '19 at 08:48
1

Additional information to this topic i found out from the GitHub thread:

The latest preview of CosmosDB Tables SDK (0.11.0-preview) has OrderBy support: https://github.com/MicrosoftDocs/azure-docs/issues/26228#issuecomment-471095278

Markus S.
  • 2,602
  • 13
  • 44