Shifted memcache logic to datastore level