App Engine 中关于陈旧数据的最佳实践

Best practices in App Engine regarding stale data

我有一个应用程序,它首先从数据存储中读取一个相当小的实体列表(不超过 1000 个,通常少于 100 个。)我有一个定期更新这些实体的服务和另一个实体只是给出最后更新的时间。

如果有的话,我该怎么做才能让对应用程序的后续调用使用最新数据?唯一可行(可靠)的是删除所有当前 运行 个实例。如果有某种方法可以通过更新服务停止当前实例,即使这样也很好。

您需要为 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 上最终一致性与强一致性的更多 in-depth 研究,请参阅 this article