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

授权模块每次启动就会加载全部资源 #189

Open
JOETION opened this issue Jan 25, 2021 · 0 comments
Open

授权模块每次启动就会加载全部资源 #189

JOETION opened this issue Jan 25, 2021 · 0 comments

Comments

@JOETION
Copy link

JOETION commented Jan 25, 2021

如题,authentication-server中每次启动就会走RPC请求所有资源,资源一般都是可以维护的,那么数据量大的话就会很吃内存,有大佬有好的解决方案吗?
我想到的一共三种:
1、第一种:up主的这种思路,先走RPC请求所有资源,然后存入内存并分组。后续增量资源通过消息进行新增
缺点就是:服务初始化时请求所有资源吃内存。增量消息有可能丢失,不一定可靠。
2、第二种:初始化资源和增量资源走redis,每次验权的时候走redis校验。redis中资源的维护都在资源模块中处理
缺点就是:redis中键不好处理,授权模块不知道该拿什么样的键去查找redis
3、第三种:不走任何缓存,直接在授权模块中操作数据库。验权的时候去数据库查找
缺点就是:每个授权都要请求数据库,效率低下。数据库压力大。
目前暂定第二种方案,大佬们有没有其他好的方案。

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

1 participant