缓存击穿问题与缓存设置顺序原则
摘要:一、正确的缓存设置顺序: 1、读:先从DB读取之后,再写到cache中 2、更新:先更新 DB 中的数据,再删除 cache (必须是删除,而不是更新cache) 错误操作1,更新DB,同时写入cache eg:进程A写了cache,此时进程B打断了A,又写cache,并写了DB,再次轮到进程A继续
阅读全文
posted @ 2017-09-19 18:38
posted @ 2017-09-19 18:38
posted @ 2017-07-31 16:52
posted @ 2017-07-31 16:23