Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
314 views
in Technique[技术] by (71.8m points)

mysql - Suggestion on a replication scheme for my use-case?

I am working on an application that runs on multiple clients that talk to one main MySQL database. Additionally, we have a web application that uses the same MySQL database.

Due to latency issues, all clients will have to run their own local MySQL database which should be a copy of the main MySQL database. The web application remains to use the main MySQL database.

The clients only read from table A, and write to table B. The web application writes both to tables A and B.

How should I setup a replication scheme that ensures data consistency? It should be possible for clients to go offline for an extended period of time. Is this even possible using MySQL or am I better of having a look at something like CouchDB? CouchDB seems to support this explicitly according to the website:

it allows for users and servers to access and update the same shared data while disconnected and then bi-directionally replicate those changes later

(from: http://couchdb.apache.org/docs/overview.html)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

CouchDB has the semantics you need if it's feasible for you to move to away from MySQL.

You wouldn't even need to "two table" system. The document system has MVCC built in so you can update documents and resolve conflicts, etc. Replication is awesome and fully peer-to-peer and intended, by design, to support offline applications.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...