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

关于主从读写分离的疑问 #55

Open
mylqwrq opened this issue Oct 27, 2020 · 2 comments
Open

关于主从读写分离的疑问 #55

mylqwrq opened this issue Oct 27, 2020 · 2 comments

Comments

@mylqwrq
Copy link

mylqwrq commented Oct 27, 2020

很多场景下需要指定少数方法读从库,这样的话一个 @Usemaster 注解不能满足需求。是否应该考虑通过增加一个 @UseSlave 注解,或者 @Usemaster 增加一个属性的方式来指定该方法走从库读,从而增加灵活性?现在查询默认全部走从库,是否不利于扩展?

@liangyanghe
Copy link
Member

@UseSlave 其实没有必要,默认读就是走从库的

@mylqwrq
Copy link
Author

mylqwrq commented Nov 19, 2020

如果想要默认走主库读(从库读少)的话,对源码的改动成本会比较高。那是否考虑将获取数据源的方法进行抽象,允许用户自定义?

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

2 participants