简体   繁体   中英

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.

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 .

For a more in-depth study of eventual vs strong consistency on Google Cloud Datastore, see this article .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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