I have taken a database class this semester and we are studying about maintaining cache consistency between the RDBMS and a cache server such as memcached. The consistency issue
When you read, the following happens:
if(Key is not in cache){ fetch data from db put(key,value); }else{ return get(key) }
When you write, the following happens:
1 delete/update data from db 2 clear cache