Cache consistency when using memcached and a rdbms like MySQL

前端 未结 4 1890
挽巷
挽巷 2021-02-14 03:41

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 04:25

    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
    

提交回复
热议问题