Yep, It's memcache. 

Indeed there is space for everything on memcache but it doesn't mean you'll 
store everything there. Each case is different, but my general rule is:

1) For every new query, I store its result on  memcache,

2) When the same query is repeated I get the result from the cache instead 
of the datastore. 

3) When data is updated I don't need to update the new information on 
cache, I just clear all occurrences of the old data on cache, thus the next 
time that record is queried, it'll not find it on cache anymore and it'll 
be forced to retrieve it from the datastore.

You can make some optimization. For instance if you have a query in cache 
with a parameter like "field1 = '10'" with less than 100 records, and the 
user queries for "field1 = '10' AND field2 ='blue', than it is cheaper to 
make a loop on your cache and get only the blue ones, than querying the 
datastore again.But this is just an example of optimization, in some cases 
it is not worthwhile, in other cases you'll need to do much more to get an 
acceptable performance.

Eventually your cache will be flooded with data that is not frequently 
used. You can make a specific routine to deal with it but for most of the 
cases an adjust on the memcache timeout may be enough. Short timeout will 
produce a high number of datastore calls, long timeouts will make your 
cache accumulate lots of useless data. You can monitor your app and find 
out which is the best timeout for you.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/tznxpwxIlEYJ.
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