About System data sync

Our system need data sync with each sub system, because data transfer is bidirectional, so can't use mysql master and slave, at present I use two way to solve this problem.
With other system, I use hibernate interceptor to intercept the changed data, and write a log to record which table which data at which time changed, and when time arrive, I searche the latest data, then generate an xml document and transfer this document to other system. XML maybe like this

<?xml version="1.0" encoding="UTF-8"?>
<datasync name="employee" site="A">
<syncdata name="id">12345</syncdata >
<syncdata name="employee name">*******</syncdata >
</datasync>
<datasync name="employee" site="B">
<syncdata name="id">2345</syncdata >
<syncdata name="email">*******</syncdata >
</datasync>

I use mysql master idea, not use slave idea as the way between our parent system an sub system data sync.
At every night, Out service call a bat file to execute some command and generate the update sql from mysqlbinlog, then according this sql, we can know which data changed, according requirement to analysis the update sql, and update data to each sub system and parent system.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值