Google Groups

Re: Datastore Small Operations - datastore.get(key)


Peter Han Apr 19, 2012 10:56 PM
Posted in group: Google App Engine
"However, you can convert queries into keys-only queries followed by
batch get()s; this will cost small datastore operations for cache
hits
rather than full read operations"

keys-only query is a small datastore operation thats is clear, but
batch get of entities by key also? Thank you.





On Apr 18, 6:49 pm, Jeff Schnitzer <j...@infohazard.org> wrote:
> On Wed, Apr 18, 2012 at 3:36 AM, cloudpre <pbx.ku...@gmail.com> wrote:
> > Jeff - thanks for the note. I have been trying to add few items in
> > memcache manually.
>
> > Can put operations also be saved? Let's say I am updating the same
> > query again after few seconds.
>
> I'm not sure what you mean here.  The cache covers get(), put(), and
> delete() operations.  Queries do not affect the cache at all.
> However, you can convert queries into keys-only queries followed by
> batch get()s; this will cost small datastore operations for cache hits
> rather than full read operations.  Objectify4 will actually do this
> for you.
>
> > Does it work flawlessly in the production? The last thing I want to
> > see is our thousands of customers coming back and complaining.
>
> There have not been any complaints for the current cache code (3.1+),
> and it is fairly widely used.  Older versions of the cache code (3.0
> and prior) had synchronization issues, but for 3.1 I rewrote it with
> some help from Ari and Alfred (Google).  It should be transactionally
> safe - even under heavy contention - as long as you don't hit
> DeadlineExceededExceptions.
>
> Jeff