开发者

database synchronisation

开发者 https://www.devze.com 2022-12-23 03:04 出处:网络
I have two databases at two different places, both databases are same with table name as well as fields. now I want to synchronise both database. Is there any java code or we can achieve that directly

I have two databases at two different places, both databases are same with table name as well as fields. now I want to synchronise both database. Is there any java code or we can achieve that directly from mys开发者_运维技巧ql or sql ? How ?


It sounds like you need to consider replication as an option.


I can do this if we have a main database (1st DB) and secondary one (2rd DB), and synchronise secondary DB when main DB changed.

when 1st DB change, you make a version number (which table change, at which row, column? and value?). the 2rd DB will check the version of it and update data for 2rd DB.

(you should reference the way that implement source control for complex situations)

0

精彩评论

暂无评论...
验证码 换一张
取 消