azure - DocumentDB 惰性索引模式 : Querying a document before the index has updated

标签 azure azure-cosmosdb document-database

为了提高写入性能,可以使用惰性索引策略。据我了解,这本质上意味着索引传播在写入后最终是一致的(与一致模式相反,在一致性模式中,写入只有在索引更新也完成后才会完成)。

Lazy index on MSDN :

To allow maximum document ingestion throughput, a DocumentDB collection can be configured with lazy consistency; meaning queries are eventually consistent. The index is updated asynchronously when a DocumentDB collection is quiescent i.e. when the collection’s throughput capacity is not fully utilized to serve user requests. For "ingest now, query later" workloads requiring unhindered document ingestion, "lazy" indexing mode may be suitable.

问题:

如果在索引更新之前查询文档(假设通过id)(它仍在延迟传播),那么该文档是否会找不到是否存在某种形式的“表扫描”并且返回的文档会牺牲 RU(和性能)?

编辑:以上假设数据库上的 session 一致性。

最佳答案

使用“id”和“_rid”属性的查询不依赖于索引策略,并且始终一致更新。即与帐户配置的一致性级别相同(在您的情况下为 session 一致性)。

使用“id”的查询始终从索引提供,是查找,而不是扫描。

关于azure - DocumentDB 惰性索引模式 : Querying a document before the index has updated,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33981564/

相关文章:

c# - Azure Cosmos DB 快速入门示例不起作用

database-design - MongoDB:存储以及何时使用关系

azure - Azure AD B2C oauth/OpenIdConnect 问题

php - 使用 PHP Zend 创建 Windows Azure 部署证书 - 例如无法下载 RDP 文件

azure - 从 Azure Function .csx 查询 CosmosDB

c# - 如何在 CosmosSDK v3+ 的 FeedResponse 中提供模拟值?

CouchDB 在运行时通过任何文档属性映射/减少?

azure-cosmosdb - 嵌套对象的 Cosmos DB SQL 查询

azure - Get-AzApiManagementSubscription 命令返回订阅列表,但键值为空

asp.net - 部署到 Azure 后出现编译错误