You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
为了避免块缓存失效而导致流量击穿到Redis or DB,需要增加一个机制将数据重新loading到Cache中。Loading的选择就分为两种,全量和热点。当然对于轻量级应用的话,全量的刷新机制是可以接受的。但是框架需要应对重度缓存需求,这就需要考虑从Caffeine中快速定位出指定量的HotKeys更新至候选刷新集合。HotKeys的筛选,也划分出了两种策略:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
缓存失效
常规情况下内存缓存失效的情况有5种:
缓存重载
为了避免块缓存失效而导致流量击穿到Redis or DB,需要增加一个机制将数据重新loading到Cache中。Loading的选择就分为两种,全量和热点。当然对于轻量级应用的话,全量的刷新机制是可以接受的。但是框架需要应对重度缓存需求,这就需要考虑从Caffeine中快速定位出指定量的HotKeys更新至候选刷新集合。HotKeys的筛选,也划分出了两种策略:
自动策略
此时服务处于存活状态,替换的逻辑是新建Cache实例,将最新引用指向到新Cache后,失效旧实例。
Beta Was this translation helpful? Give feedback.
All reactions