Cache consistency when using memcached and a rdbms like MySQL

后端 未结 4 819
太阳男子
太阳男子 2021-02-14 03:59

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

4条回答
  •  清歌不尽
    2021-02-14 05:07

    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
    

提交回复
热议问题