简体   繁体   中英

is google appengine datastore.get(key) consistent?

I've read the consistency page on

https://cloud.google.com/appengine/docs/java/datastore/structuring_for_strong_consistency

now i know that for queries to be consistent you need to use ancestor queries.

What about single key? query for example:

Entity e = datastore.get(Key)

are they eventually consistent or strongly consistent? please do cite references or links

Yes, a get with a specific key is always consistent.

The documentation isn't as clear about this as it could be, but a get is not a query: it's a simple lookup in what is basically a key-value store. That will always return the correct data. It is only queries that can be inconsistent, because they must be done against indexes and the index update can lag.

The only reference I can give you is to point out that get is discussed on the Entities, Properties and Keys page whereas data consistency is discussed on the Datastore Queries page .

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