Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

集群模式一级缓存消息通知刷新或清空 #260

Open
zangyk opened this issue Mar 12, 2019 · 15 comments
Open

集群模式一级缓存消息通知刷新或清空 #260

zangyk opened this issue Mar 12, 2019 · 15 comments

Comments

@zangyk
Copy link

zangyk commented Mar 12, 2019

集群情况下,一级缓存过期时间如果设置的比较长,可能获得的缓存是比较老的数据,如果设置的时间比较短,又失去一级缓存的意义,j2cahce中有通过消息通知的形式刷新或清空集群一级缓存的功能,jetcahce是否可以考虑支持一下?

@gumutianqi
Copy link

这个需要自己结合实际情况实现,jetcache 只是单一的 cache 工具

@zangyk
Copy link
Author

zangyk commented Mar 12, 2019

这个从业务层面抽象出来,提升为公共功能,该功能基本不和业务功能绑定,是纯粹的技术实现,jetcache层面支持是最为理想的解决方案。

@areyouok
Copy link
Collaborator

我有想过在redis里面通过pub/sub做一下,不过还没来得及

以后可能会有

@wujun8
Copy link

wujun8 commented Apr 12, 2019

remote 缓存提供了订阅通知机制的,如 Redis Keyspace Notifications ,可以集成下,主要诉求是在分布式环境下各个客户端节点的 local 缓存的一致性,这个特性有很强需求的

@wujun8
Copy link

wujun8 commented Apr 12, 2019

Because Redis Pub/Sub is fire and forget currently there is no way to use this feature if your application demands reliable notification of events, that is, if your Pub/Sub client disconnects, and reconnects later, all the events delivered during the time the client was disconnected are lost.

Redis Keyspace Notifications 还是不可靠,通过 local 缓存的定时刷新实现一定延迟下的一致性是不是更好?

@areyouok
Copy link
Collaborator

jetcache可以定时自动刷新,或者1级缓存设置较短的超时时间

@subenkun
Copy link

subenkun commented May 2, 2019

如果一级缓存设置较短的超时时间,个人觉得没必要用一级缓存了。应该一级缓存没有数据去二级缓存取,并存入一级缓存,下次直接取一级缓存数据,当一级缓存数据发生变化时应该通知其他节点更新数据。

@dslchd
Copy link

dslchd commented May 5, 2019

这个特性在分布式集群的时候,是真的很有必要。

@fxfh0504
Copy link

最近也在研究这个问题 因为我们集群中一级缓存设置的时间会比较长,在某一节点缓存更新的时候需要通知其他结点更新数据

@isevenluo
Copy link

jetcache定时自动刷新,假设设置每分钟刷新,假如有20台机器,所有机器的刷新时间是同一时刻刷新,还是每台机器都有自己的计数器,各自在不同时间点只要到了1分钟就刷新?

@zhousenshan
Copy link

我有想过在redis里面通过pub/sub做一下,不过还没来得及

以后可能会有

我是利用redis pub/sub特性做了,但是刚接触,并不清楚 如何清掉 方法注解缓存 里保存的一级缓存

@dean20191028
Copy link

本来也是打算使用这款框架的,但是确实没有一级缓存的自动刷新和清空功能,有点纠结。给一级缓存设置短的缓存时间,就失去一级缓存的意义了

@Accusstomed
Copy link

用redis的pub/sub做的话已经就不可靠了

@Mr2017666
Copy link

我有个思路不知道可否能行,可以把本地缓存当做是一个小的热点缓存池子,所有的数据从远程缓存中取到本地缓存中,如果热点缓存有变动,通过mq进行广播模式通知变更,需要对jetcache进行拓展本地缓存监控,算法计算出热点key ,淘汰冷数据,本地热点阀值预警

@giantoneday
Copy link

最新版本中有了准实时的刷新机制了吗?

@zangyk zangyk changed the title 集群下一级缓存消息通知刷新或清空 集群模式一级缓存消息通知刷新或清空 Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests