If I set the expires time for an object I store in the memcache to 5 seconds, will it definitely not exist in the memcache 10 seconds later?
+8
A:
Here's what the App Engine for Java Doc says:
The app can provide an expiration time when a value is stored, as either a number of seconds relative to when the value is added, or as an absolute Unix epoch time in the future (a number of seconds from midnight January 1, 1970). The value will be evicted no later than this time, though it may be evicted for other reasons.
So my understanding is it that the data will no longer be present after the specified expiration time.
However as the Memcache server probably runs on a different node than the webserver servicing the request the clock of both servers may not be perfectly synchronized.
Alexandre Jasmin
2010-04-09 00:35:24
nitpick: given the architecture, I'd be surprised if timeout eviction is a high-priority task so a datum could well persist beyond the expiration time (but perhaps is discarded by a retrieve action). I'd also be surprised if Google's servers have clock dispersion greater than 1ms, since bad things would happen and clock synch with ntp is a solved problem. But +1 anyway for a well-turned answer.
msw
2010-06-13 21:35:27