我可以设置过滤的星型数据库复制吗? [英] Can I set up a filtered, star-pattern database replication?

查看:129
本文介绍了我可以设置过滤的星型数据库复制吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个客户端需要设置N个本地数据库,每个数据库包含一个站点的数据,然后有一个主公司数据库,包含所有N个数据库的并集。个别网站数据库中的更改需要传播到主数据库,并且主数据库中的更改需要传播到相应的个人网站数据库。



已经为需要两个同时保持最新的数据库的客户端使用MySQL复制。这是一个双向复制。如果我们尝试完全相同的方法在这里,我们将结束所有N个本地数据库等效于主数据库,这不是我们想要的。不仅每个单独的站点都不能看到来自其他站点的数据,从主站发送N次数据而不是只发送一次可能是一个巨大的浪费。



我用MySQL完成这个新的星型模式的选择是什么?我知道我们只能复制某些表,但是有办法通过记录过滤复制吗?



有没有什么工具可以帮助或竞争RDBMS

解决方案

可能值得一看的是来自maatkit的mysql-table-sync ,它允许您使用可选的 - where 子句同步表。 p>

We have a client that needs to set up N local databases, each one containing one site's data, and then have a master corporate database containing the union of all N databases. Changes in an individual site database need to be propagated to the master database, and changes in the master database need to be propagated to the appropriate individual site database.

We've been using MySQL replication for a client that needs two databases that are kept simultaneously up to date. That's a bidirectional replication. If we tried exactly the same approach here we would wind up with all N local databases equivalent to the master database, and that's not what we want. Not only should each individual site not be able to see data from the other sites, sending that data N times from the master instead of just once is probably a huge waste.

What are my options for accomplishing this new star pattern with MySQL? I know we can replicate only certain tables, but is there a way to filter the replication by records?

Are there any tools that would help or competing RDBMSes that would be better to look at?

解决方案

Might be worth a look at mysql-table-sync from maatkit which lets you sync tables with an optional --where clause.

这篇关于我可以设置过滤的星型数据库复制吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆