简体   繁体   English

Cosmos DB 可能 window 的陈旧读取与 Session 在单个区域中的一致性

[英]Cosmos DB possible window of stale read with Session Consistency in a single region

According to the Microsoft docs: "single client session reads are guaranteed to honor the consistent-prefix, monotonic reads, monotonic writes, read-your-writes, and write-follows-reads guarantees"根据 Microsoft 文档:“单个客户端 session 读取保证遵守一致的前缀、单调读取、单调写入、读你写和写后读保证”

As I understand, a separate client/session would observe Consistent Prefix reads.据我了解,单独的客户端/会话会观察到一致的前缀读取。

  1. Is this due to local replica sets which have yet to be updated?这是由于尚未更新的本地副本集造成的吗?

  2. Are there any guarantees on how long it take and what the possible window of a stale read is?是否可以保证需要多长时间以及过时读取的可能 window 是多少?

I'm trying to understand what the tradeoff is and whether the additional costs of Bounded Staleness consistency is worth it.我试图了解权衡是什么,以及有界陈旧一致性的额外成本是否值得。

https://learn.microsoft.com/en-us/azure/cosmos-db/consistency-levels#session-consistency https://learn.microsoft.com/en-us/azure/cosmos-db/consistency-levels#session-consistency

Yes, it is because reads are from a single replica and may not see the latest update but will get all updates in order written.是的,这是因为读取来自单个副本,可能看不到最新更新,但会按写入顺序获取所有更新。 All data is written to 3 replicas.所有数据都写入 3 个副本。

There are no guarantees for how quickly data is replicated to the fourth replica.无法保证数据复制到第四个副本的速度有多快。 And while there is no guidance how quickly data is consistent across a replica set, the service will try to commit data into the fourth replica as quickly as possible.虽然没有指导数据在副本集中保持一致的速度有多快,但该服务将尝试尽快将数据提交到第四个副本中。

It's only when using Bounded Staleness that the service will throttle writes if data is not fully replicated within 5 seconds or 10 updates.只有在使用 Bounded Staleness 时,如果数据未在 5 秒或 10 次更新内完全复制,该服务才会限制写入。

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

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