通过选择自定义数据格式进行 MySQL 复制
考虑到目标数据库的结构略有不同,是否可以通过仅选择要复制的表(到目标数据库)来复制 mysql 数据库。
请考虑以下事项:
我有一个数据库,其中加载了需要复制到目标数据库的所有数据。我们将其称为 MasterDatabase
现在我有了 TargetDatabase
,这是 MasterDatabase
的精简版本,将用于表示层。请注意,这两个数据库具有不同结构的表。
在这种情况下可以复制吗?
如果没有,是否有解决方案可以从 MasterDatabase
更新 TargetDatabase
上的数据,而无需进行大量更新,也许可以像普通复制一样进行选择性更新?
Is it possible to replicate a mysql database by choosing only the tables you want to be replicated (unto the target database) considering the target database has a slightly different structure.
Consider the following:
I have a database loaded with all the data I need to be replicated to the target database. Let's call this our MasterDatabase
Now I have the TargetDatabase
this is a lite version of the MasterDatabase
and will be used will be used for the presentation layer. Note that the two database have tables with different structures.
Is replication possible in this scenario?
If not, is there a solution to update the data on the TargetDatabase
from the MasterDatabase
without doing massive updates maybe selective updates just as a normal replication would work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
复制在某种程度上是灵活的,您可以复制到不同的存储引擎,是的,甚至有选择地选择您想要复制的数据。
请记住,复制意味着源数据集的相同副本。如果您的架构中需要不同的格式或不同的表定义,那么它就不再是真正的数据复制。
Replication is somewhat flexible in the sense you can replicate to different storage engines, and yes, even selectively choose the data you want replicated.
Keep in mind though that replication is meant to be an identical copy of your source dataset. If you need different formats or different table definitions in your schema, it is not really data replication anymore.