Cache consistency when using memcached and a rdbms like MySQL

前端 未结 4 1889
挽巷
挽巷 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:11

    How about using a variable save in memcache as a lock signal?

    every single memcache command is atomic

    after you retrieved data from db, toggle lock on

    after you put data to memcache, toggle lock off

    before delete from db, check lock state

提交回复
热议问题