同步应用程序
我有一个独立的网络设备。它需要重新设计才能作为这些设备的地理分布组的一部分。组中的设备之间的同步不需要频繁发生,不超过每小时一次。该应用程序是带有 SQLite 的 Rails。
主要是,我们希望保持这些设备上收集的某些信息同步。由于部署原因,添加大型数据库集群是不可行的。
我一直在考虑 CouchDB,因为复制和处理复制引起的冲突是它的强项。
您如何看待 CouchDB 作为保持分布式网络设备同步的机制?对于替代方法有什么想法或建议吗?
I have a standalone network device. It needs to be reworked to function as part of a geographically distributed group of these devices. Synchronization between devices in the group need not occur frequently, not more than hourly. The application is rails with SQLite.
Mainly, we want to keep certain pieces of information collected on these devices in sync. Because of the deployment, it isn't feasible to add a large database cluster.
I have been considering CouchDB since replication and handling conflicts resulting from replication is a strong suit of its.
What do you think of CouchDB as a mechanism to keep distributed network devices synchronized? Any thoughts or suggestions for an alternative approach?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
具体问题是什么?
CouchDB 实现了主主复制,这正是您所要求的。
或者?
What is the particular question?
CouchDB implements master-master replication which is exactly what you are asking for.
Or?
CouchDB 非常适合于此,因为正如您所说,它具有主主复制功能。由于您是通过 WAN 进行复制,因此另一个巨大的补充是 CouchDB 旨在优雅地处理网络的进出,这将是一个很好的容错功能。
很多人都使用 CouchDB 来应对这种情况。查看一些案例研究 (http://www.couchbase.com/customers/case-studies )以及我最近写的一篇关于使用 CouchDB 保持前端服务器会话数据同步的博客文章(weblog.bocoup.com/storing-php-sessions-in-couchdb)。
此外,如果您发布有关您的案例的更多信息也会有所帮助,以便我们可以帮助提供答案。
干杯。
CouchDB would be a great fit for this, because as you say, it has master-master replication. Since you're replicating over the WAN, another huge add is that CouchDB was designed to handle going on and off the network gracefully, which will be a nice piece of fault tolerance.
A lot of people have used CouchDB for this type of situation. Take a look at some case studies (http://www.couchbase.com/customers/case-studies) and a recent blog post I wrote about using CouchDB to keep front end servers' session data synchronized (weblog.bocoup.com/storing-php-sessions-in-couchdb).
Also, it would help if you posted more information about your case so that we can help cater our answers.
Cheers.
CouchDB 没问题。您可能有一些 Unix 工具的替代方案。
最简单的键/值数据库是文件系统中的文件。他们工作得很好。如果您只需要具有基本复制功能的键/值存储,那么 rsync 可以做到这一点。例如,如果您的冲突解决策略是始终采用最新的带时间戳的数据,那么您可能会摆脱 rsync。
首先,您可能正在运行 Unix/Linux。与 CouchDB 不同,SSH 和 rsync 将被包含在内。
rsync(实际上是它的 SSH 隧道)的另一个优点当然是识别、身份验证和授权。您的设备可能是 Unix/Linux,并且有一百万种方法来连接 Unix 授权。这不是保证,但几乎任何事情都是可行的:密码文件、NIS、LDAP、Kerberos、Samba/Active Directory。这样的例子还在继续。
使用 Couch,您将必须找出某种用户管理系统。
_users
数据库吗?_users
数据库中存在冲突怎么办?_users
数据库?如果没有中央数据数据库,怎么能拥有中央用户数据库呢?Couch 与 MySQL 一样,是一个成熟的服务器。它会产生 rsync 不会的维护负载。
.ini
配置换句话说,你能做一个快速而肮脏的事情吗? rsync hack,或者您需要完整的 Couch 包吗?
CouchDB 是一个统一、一致的平台,与操作系统无关。这可能是好是坏。不知道你的具体情况,我猜想通过 SSH 进行 rsync 是最好的短期方案,但 Couch 是最好的长期方案。 (但对于如此多的软件项目,长期似乎永远不会到来。)
CouchDB is fine. You might have some alternatives with Unix tools.
The simplest key/value database is files in a filesystem. They work great. If you only need key/value storage with basic replication, then rsync can do that. If your conflict resolution policy is, for example, always take the latest timestamped data, then you might get away with rsync.
First of all, you're probably running Unix/Linux. SSH and rsync will be included, unlike CouchDB.
Another advantage of rsync (actually its SSH tunnel) is of course identification, authentication, and authorization. Your device is presumably Unix/Linux, and there are a million ways to wire up Unix authorization. It's not a guarantee but nearly anything is doable: password files, NIS, LDAP, Kerberos, Samba/Active Directory. The list goes on.
With Couch you will have to figure out some kind of user management system.
_users
database around? What about conflicts in the_users
database?_users
database? How can you have a central users database if you can't have a central data database?Couch, like MySQL, is a full-blown server. It will maintenance load that rsync won't.
.ini
configIn other words, can you do a quick and dirty rsync hack, or do you need the full Couch package?
CouchDB is a uniform, consistent platform regardless of OS. That can be good or bad. Not knowing your specifics, I would guess that rsync over SSH is the best short-term, but Couch is the best long-term. (But with so many software projects, long-term never seems to arrive.)