Cache consistency when using memcached and a rdbms like MySQL

后端 未结 4 675
无人及你
无人及你 2021-02-14 04:32

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:01

    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
    

提交回复
热议问题