简体   繁体   English

Cosmos DB Change Feed 的时间分辨率是多少?

[英]What is the time resolution of Cosmos DB Change Feed?

It is my understanding (eg from here ) that the Cosmos DB Change Feed is not guaranteed to trigger an event for each update.据我了解(例如从此处),Cosmos DB Change Feed 不能保证每次更新都会触发一个事件。 For example, when two updates to the same document occur almost simultaneously it can happen that the Change Feed Processor (eg an Azure Function listening to the Change Feed) is triggered only once, namely for the later of the two updates.例如,当对同一个文档的两次更新几乎同时发生时,更改提要处理器(例如 Azure Function 监听更改提要)可能只被触发一次,即两次更新中的较晚一次。 First of all, is my understanding correct?首先,我的理解正确吗? If yes:如是:

  1. What is, from your experience, a typical minimal time interval for updates such that a change event is triggered for each event individually?根据您的经验,更新的典型最小时间间隔是多少,以便为每个事件单独触发更改事件? (Not an exact value, but just the order of magnitude would already be helpful.) (不是精确值,只是数量级就已经有用了。)
  2. Is there an SLA for this time interval?这个时间间隔是否有 SLA?

Change feed is polling based rather than event based though so depends how often you poll for changes with the incremental model.更改提要是基于轮询而不是基于事件的,但这取决于您使用增量 model 轮询更改的频率。

The processor just keeps track of the highest LSN it has read per partition and requests the next batch of changes from that bookmark point onwards (in LSN order).处理器只跟踪每个分区读取的最高 LSN,并请求从该书签点开始的下一批更改(按 LSN 顺序)。

Every time a document is updated its associated LSN is increased so, in order for a specific version to be returned in the change feed, the change feed processor would need to request a batch containing that LSN before the document is updated.每次更新文档时,其关联的 LSN 都会增加,因此,为了在变更源中返回特定版本,变更源处理器需要在更新文档之前请求包含该 LSN 的批次。

For Azure functions you can reduce feedPollDelay to make it less likely that you will miss changes对于 Azure 函数,您可以减少feedPollDelay以减少错过更改的可能性

(Optional) The time (in milliseconds) for the delay between polling a partition for new changes on the feed, after all current changes are drained. (可选)在耗尽所有当前更改后,轮询分区以获取提要上的新更改之间的延迟时间(以毫秒为单位)。 Default is 5,000 milliseconds, or 5 seconds.默认值为 5,000 毫秒,即 5 秒。

If your changes are very close together you will likely still miss them though.如果您的更改非常接近,您可能仍然会错过它们。 There is a " full fidlelity change feed " option coming at some point that will return all changes but I'm not sure how to get onto the preview or when it will be GA and integrated with Azure functions.有一个“ full fiddelity change feed ”选项会在某个时候出现,它将返回所有更改,但我不确定如何进入预览或何时它会 GA 并与 Azure 功能集成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM