Transaction isolation implications for PKs

1 view
Skip to first unread message

phraktle

unread,
Nov 26, 2008, 12:52:23 PM11/26/08
to Google App Engine, maxr+ap...@google.com
Hi,

I've read the article at http://code.google.com/appengine/articles/transaction_isolation.html
and I understand the two milestones concept. However, I need
clarification on the following:

Is the primary key considered an index? (if so, this would mean, that
a get() after a put() may not always find the entity just stored)

Thanks,
Viktor

ryan

unread,
Nov 26, 2008, 5:40:34 PM11/26/08
to Google App Engine
hi viktor! that's a common misconception that people have after
reading that article. queries and get()s *after* a put() are always
consistent. this is why we say that the datastore is strongly
consistent. within the same request, once a put() returns
successfully, all subsequent get()s and queries will be fully
consistent and include the entity (or entities) that were put().

to answer your question more directly, get() does not use an index.
it's a direct lookup by primary key. the inconsistencies discussed in
that article are limited to queries, not get()s, and can only happen
when one request does a put() and another concurrent request runs a
query.

phraktle

unread,
Nov 27, 2008, 3:22:02 AM11/27/08
to Google App Engine

Thanks Ryan, that settles it :)

Perhaps this should be explicitly stated in the article/docs.

Viktor
Reply all
Reply to author
Forward
0 new messages