简体   繁体   English

对“ __key__”属性的查询是否与GAE数据存储区高度一致?

[英]Are queries on the “__key__” property strongly consistent with GAE datastore?

I know generally queries on the GAE datastore are eventually consistent. 我知道一般来说,GAE数据存储区上的查询最终都是一致的。 However I don't see why queries on __key__ should not be strongly consistent as I presume this is what the datastore Get function uses. 但是我不明白为什么对__key__查询不应高度一致,因为我认为这是数据存储区Get函数使用的。

Can anyone confirm querying by __key__ is strongly consistent? 谁能确认__key__查询是高度一致的?

A query will be consistent only on ancestor queries. 一个查询将仅在祖先查询上是一致的。 Otherwise is not consistent even if the index contains key entries. 否则即使索引包含键条目也不一致。 This is because writes are applied in two phases, one to write your data and other to update indexes. 这是因为写入分两个阶段进行,一个阶段用于写入数据,另一阶段用于更新索引。 Get by key neves uses an index so its always correct. 按关键点获取使用索引,因此它始终正确。 I assume that you are generating semi-secuential keys otherwise a query with key wouldnt be useful. 我假设您正在生成半安全密钥,否则使用密钥查询将不会有用。 Beware however that appengine now recommends to spread your keys so they cover a large space and is thus better distributed in bigtable. 但是请注意,appengine现在建议散布您的密钥,以使其覆盖较大的空间,从而更好地分布在bigtable中。

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

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