Azure Table 存储表是否保证按 Partition/Row 排序?

Are Azure Table Storage tables guaranteed to sort by Partition/Row?

当我执行此操作时:

query = new azure.TableQuery().top(100).where("PartitionKey eq ?", someKey);

这是否保证这100个结果按RowKey顺序返回?我读到的所有内容都让我相信记录的顺序是单一的,而且是 PartitionKey + RowKey。我自己的基本测试似乎证实了这一点。但是我找不到任何官方文档直接说出来。

我只需要知道我是否可以依赖它,或者它是否有可能改变。

结果将按其 RowKeys 的词汇顺序排列。此处描述的一种称为 Log Tail 模式的官方设计模式: https://docs.microsoft.com/en-us/azure/cosmos-db/table-storage-design-guide#log-tail-pattern

依赖于这个确切的事实,即在一个分区内,实体将按照其 RowKey 的词法顺序进行排序。

我一直怀疑基本 table 存储服务无论如何都会发生变化。

所以这里有趣的一点是,如果您在基本 table 存储上构建解决方案,依赖分区内的 RowKeys 的词法排序,然后如果您迁移到 Cosmos DB table api(最终)在封面下依赖于文档数据库,该假设是否仍然成立。

我可以确认 Table API 返回的 Cosmos DB 查询结果没有按分区 key/row 键顺序排序,因为它们在 Azure Table 贮存。 - https://docs.microsoft.com/en-us/azure/cosmos-db/faq#where-is-table-api-not-identical-with-azure-table-storage-behavior

我向他们提出了这个问题,并指出了其他文档中的矛盾信息,例如上面提到的日志尾模式,他们回复了 "The https://docs.microsoft.com/en-us/azure/cosmos-db/table-storage-design-guide doc was initially written for Table storage only. Later when Table API in Cosmos DB and Azure Table storage are merged, the docs were brought to Cosmos DB space. I think there are some issues with the existing Table API docs and we are in the process of revamping our docs, will get to the Table API docs soon."

看到他们的回复我差点晕过去。在没有任何排序功能的情况下,人们究竟如何将他们的应用程序从 Azure Table 存储迁移到 CosmosDB。您真正能做的就是点查询,这几乎使将 Azure Table 存储迁移到 CosmosDB 无法满足我的需求。

如果您也希望看到 CosmosDB 至少按字典顺序索引 RowKey,请给我的 CosmosDB 建议投赞成票:https://feedback.azure.com/forums/263030-azure-cosmos-db/suggestions/36124006-table-api-sort