关于我的用例的复制方案的建议?
我正在开发一个在多个客户端上运行的应用程序,这些客户端与一个主 MySQL 数据库进行通信。此外,我们还有一个使用相同 MySQL 数据库的 Web 应用程序。
由于延迟问题,所有客户端都必须运行自己的本地 MySQL 数据库,该数据库应该是主 MySQL 数据库的副本。 Web 应用程序仍然使用主 MySQL 数据库。
客户端仅从表 A 读取,并写入表 B。Web 应用程序同时写入表 A 和 B。
我应该如何设置确保数据一致性的复制方案?客户端应该可以长时间离线。使用 MySQL 是否可以做到这一点,或者我是否最好看看 CouchDB 之类的东西?根据网站,CouchDB 似乎明确支持这一点:
它允许用户和服务器 访问和更新相同的共享数据 断开连接然后 稍后双向复制这些更改
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您可以放弃 MySQL,CouchDB 具有您需要的语义。
您甚至不需要“两张桌子”系统。文档系统内置了 MVCC,因此您可以更新文档并解决冲突等。复制非常棒,并且完全点对点,并且在设计上旨在支持离线应用程序。
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.