Here is the scenario: a simple website which queries a memcached cache. That same cache is updated by a batch job every 10-15 minutes. With that pattern is there anything that could go wrong (e.g. cache miss)?
I am concerned by all the possible racing condition that could happen. For example, if the website does a GET operation on an object cached in memcached while that same object is overridden by the batch job, what will happen?
My initial instinct was that you should be able to read/write from a memcached cache with no side effects (other than a possibility of stale data due to race conditions).
On memcached’s FAQ:
Without knowing more about your specific situation, I would not be able to advise on whether or not a cache miss was possible, but I do make a generalization that the cache should be a first tier for seeking data and not the ONLY tier; I would still have a database or some other source behind the cache to handle all of your cache misses.