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

和mycat之类的分布式数据库中间件打通 #75

Open
xujinhua01 opened this issue Aug 27, 2019 · 8 comments
Open

和mycat之类的分布式数据库中间件打通 #75

xujinhua01 opened this issue Aug 27, 2019 · 8 comments
Labels
enhancement New feature or request

Comments

@xujinhua01
Copy link

描述您想要的功能:
希望能和mycat之类的分布式数据库中间件打通,这样在配置数据源的时候可以直接连接mycat,数据库分库后,上线SQL,就可以直接一次性将其路由到所有分库去执行相同的SQL。

描述您考虑过的解决/替代方案:

可参考文档,资料,引用等:

@hanchuanchuan
Copy link
Owner

审核和执行还好,主要麻烦在备份上,如果多个分库执行的话,binlog回滚比较难做。

@xujinhua01
Copy link
Author

备份回滚,应该也是根据分库路由配置,然后去具体的物理库去备份和进行回滚吧?或者做一个说明,分库执行的SQL不宜过大的说明或者限制。或者这个不支持备份,回滚。不然分库太多的话,一个个去执行比较费劲啊。

@hanchuanchuan
Copy link
Owner

如果分库太多的话,怎么确定是谁执行了某条SQL呢,或者是一条update影响了多个分库,这时做binlog解析就需要去所有的分库都检查一下是否有数据变更。
如果不做备份,只是执行的话倒还好。

@hanchuanchuan hanchuanchuan added the enhancement New feature or request label Sep 25, 2019
@swords1999
Copy link

可以通过select去查询备份。

@swords1999
Copy link

备份文件就不是DML的逆向操作,只是单纯的select结果。这是一个同行的办法。

@zwunix
Copy link

zwunix commented Aug 18, 2020

类似可以支持DRDS这些中间件

@wing731
Copy link

wing731 commented Jul 1, 2021

那目前支持能在mycat执行DDL?不需要备份的话

@quanbisen
Copy link

那目前支持能在mycat执行DDL?不需要备份的话

现在是支持的,我目前有在用,不过有一个问题,goinception每次执行的时候会判断数据库是否是read_only模式,如果mycat是读写分离模式的话,goinception可能会直接返回,不执行了,参见代码
if s.checkIsReadOnly() { s.appendErrorMessage("当前数据库为只读模式,无法执行!") return }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants