App Engine高复制数据存储 [英] App Engine High Replication Datastore

查看:101
本文介绍了App Engine高复制数据存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是App Engine的新手,我想确认我对高复制数据存储的理解。

文档说实体组是一个一致性单元,并且所有数据最终都是一致的。同样,它也表示跨实体组的查询可能是陈旧的。

有人可以提供一些例子,说明查询可能陈旧吗?是不是说我可以在没有任何父母的情况下保存一个实体(即它是自己的组),然后很快查询并找不到它?这是否也意味着,如果我希望数据始终保持100%的最新状态,我需要将它们全部保存在同一个实体组中?



是常用的解决方法这是为了使用memcache来缓存实体的时间长于数据在所有数据中心间保持一致的平均时间?什么是球场延迟?

谢谢解决方案$ b

它是否说我可以节省
一个没有任何父母的实体(即它是
自己的组),然后很快查询它
并且找不到它? / p>

正确。从技术上讲,这也是常规主从式数据存储的情况,因为索引是异步更新的,但在实践中,可能发生的时间窗口非常小,您从不会看到它。



如果通过查询,你的意思是做一个按键获取,但是,这将始终返回任何一个实现中强烈一致的结果。


这也意味着如果我希望数据
始终保持100%最新,我需要
将它们全部保存在同一个实体中
组?

您需要在可以回答之前定义100%最新的含义。


对于
,常见的解决方法是使用memcache缓存实体的时间长于
的时间在所有数据中心中,数据的平均成本是

没有。 Memcache严格限制访问次数;你不应该在缓存逐出会导致麻烦的情况下使用它。



如果你需要保证你看到最新版本。如果没有你想要做的具体事例,很难提供建议。


I'm a total App Engine newbie, and I want to confirm my understanding of the high replication datastore.

The documentation says that entity groups are a "unit of consistency", and that all data is eventually consistent. Along the same lines, it also says "queries across entity groups can be stale".

Can someone provide some examples where queries can be "stale"? Is it saying I could potentially save an entity without any parent (ie. it's own group), then query for it very soon after and not find it? Does it also imply that if I want data to be always 100% up-to-date I need to save them all in the same entity group?

Is the common workaround for this to use memcache to cache entities for a period of time longer than the average time it takes for data to become consistent across all data centers? What's the ballpark latency for that?

Thanks

解决方案

Is it saying I could potentially save an entity without any parent (ie. it's own group), then query for it very soon after and not find it?

Correct. Technically, this is the case for the regular Master-Slave datastore, too, as indexes are updated asynchronously, but in practice the window of time in which that could happen is so incredibly small you never see it.

If by "query" you mean "do a get by key", though, that will always return strongly consistent results in either implementation.

Does it also imply that if I want data to be always 100% up-to-date I need to save them all in the same entity group?

You'll need to define what you mean by "100% up-to-date" before it's possible to answer that.

Is the common workaround for this to use memcache to cache entities for a period of time longer than the average time it takes for data to become consistent across all data centers?

No. Memcache is strictly for improving access times; you shouldn't use it in any situation where cache eviction will cause trouble.

Strongly consistent gets are always available to you if you need to guarantee that you're seeing the latest version. Without a concrete example of what you're trying to do, though, it's difficult to provide a recommendation.

这篇关于App Engine高复制数据存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆