开发者

how to sync sqlite to Mysql

开发者 https://www.devze.com 2023-01-22 20:31 出处:网络
HI everybody, i have a question if i have a computer run sqlite , and i want to makesqlite sync Mysqlserver in the external network.

HI everybody, i have a question if i have a computer run sqlite , and i want to make sqlite sync Mysql server in the external network. If t开发者_开发知识库he data in the sqlite have been (changed/ modified), how can I sync my MYSQL DB and sqlite so that the data in sqlite will be (changed/ modified) when the data in MYSQL DB is changed/ modified?

thanks all.


You can try greplicator

geplicator is a real-time solution designed to replicate data from MySQL database to any other relational database, such as Oracle, Microsoft SQL Server, IBM DB2 UDB and MySQL.


I have a similar problem of 2-way syncing between an Android sqlite DB and a central MySql DB. The problem really comes when inserts are made, because it admits the possibility of replicated primary keys.

I did build a system a while back that used hardware and time-based GUID primary keys instead of simple, monotonically increasing primary keys. The theory is that if new records are inserted either on the handset using sqlite, or in the central server using mysql, the keys will never conflict because they are globally unique.

Unfortunately, this means you have get in the primary key management business instead of just taking the automatic one that comes with both DB engines. But in theory this approach allows data from many different handsets to be melded easily in the central database and redistributed back out to all the handsets. I am considering this approach for my Android problem although I'm still hoping to find a solution already crafted out there.

0

精彩评论

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