简体   繁体   English

App Engine中有关过时数据的最佳做法

[英]Best practices in App Engine regarding stale data

I have an application which begins by reading in a fairly small list of entities from the Datastore (no more than 1000, and often less than 100.) I have a service which updates these entities regularly and one other entity which simply gives the time of the last update. 我有一个应用程序,它首先从数据存储区中读取相当小的实体列表(不超过1000个,通常少于100个。)我有一个服务,可以定期更新这些实体,而另一个实体仅提供时间最后更新。

What can I do, if anything, to get subsequent calls to the application to use the newest data? 我该怎么做,以获取对应用程序的后续调用以使用最新数据? The only thing that works (reliably) is to delete all currently running instances. 唯一有效的方法是删除所有当前正在运行的实例。 Even that would be fine if there were some way to stop current instances through the update service. 如果有某种方法可以通过更新服务停止当前实例,那么即使这样也很好。

What you need is to structure your data for strong consistency . 您需要的是构建数据以实现高度一致性 Normal queries in Google Cloud Datastore is eventually consistent so you won't always get the newest data unless you either perform an ancestor query or a global query . Google Cloud Datastore中的普通查询最终是一致的,因此,除非您执行祖先查询或全局查询,否则您将不会总是获得最新数据。

For a more in-depth study of eventual vs strong consistency on Google Cloud Datastore, see this article . 有关Google Cloud Datastore上最终一致性与强一致性的更深入研究,请参阅本文

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

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