This shouldn't be a Topic for debate.  YES. Check Instance, Check MemCache,
Check DataStore. Always Every Time.   Well assuming you have implemented
"Write to Instance, Write To Memcache, Write to Datastore"
 
I might also throw an exception in for you are operating of HTTPS.  When you
are in HTTP, simply visiting a page can cause your ISP, Alexa, Google, and a
host of other things to also visit the page.  You can get 50% cache hits on
what would seem like unique data, just because of the Transparent Nat at the
ISP or Office, Google Adwords/Adsense bot, Bing Bot, etc.
 
 
From: [email protected]
[mailto:[email protected]] On Behalf Of Andrin von
Rechenberg
Sent: Thursday, January 05, 2012 2:11 PM
To: [email protected]
Subject: Re: [google-appengine] Re: Caching datastore gets in memcache,
worth it?
 
True, but there is also CPU overhead for the two rpcs if the Cache Hit ratio
is low....
-A
On Jan 5, 2012 6:02 PM, "Jason Collins" <[email protected]> wrote:
There is still $$ difference. Memcache is (or appears to be) free,
datastore reads are not.
j

On Jan 5, 8:01 am, Andrin von Rechenberg <[email protected]> wrote:
> Hey there
>
> For latency reasons we cache frequently fetched datastore
entities:http://code.google.com/appengine/articles/scaling/memcache.html#ent
it...
>
> *def getProfile(id):*
> *  profile = memcache.get(id)*
> *  if not profile:*
> *    profile = datastore.get(id)*
> *    memcache.put(profile)*
> *  return profile*
> *
> *
> So we first check if we can get it from memcache,
> if not we get it from datastore and put it into memcache.
> Simple. In many cases the a profile is not in memcache,
> because we have a lot of profiles. So we do 3 RPCs.
>
> Looking a bit at appstats it seems that these days a
> datastore.get_by_key_name is as fast as a memcache.get
> in many cases, so I'm wondering if google has put a
> memcache infront of datastore and the pattern I'm doing
> above is obsolete and I could save the extra RPCs?
>
> Or maybe datastore is just having a good day?
>
> Cheers,
> -Andrin

--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected]
<mailto:google-appengine%[email protected]> .
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.
-- 
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to