具有共享数据可伸缩性的CouchDB每用户数据库 [英] CouchDB db-per-user with shared data scalability

查看:78
本文介绍了具有共享数据可伸缩性的CouchDB每用户数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有以下体系结构的应用程序:

I have an application with the following architecture:

需要主沙发床共享用户之间的数据。 EG:如果用户1将数据写入云,这将复制到主服务器,然后再复制回用户2和用户3。

The master couchdb is required to share data between the users. EG: If user-1 writes data to the cloud, this replicates to the master and back to user-2 and user-3.

但是,随着用户数量的增加,云用户的bedDB数量也随之增加,这导致云用户benchDB与主bedDB之间存在大量复制链接。

However, as the user base increases so do the number of cloud user couchDBs, which results in a large number of replication links between the cloud user couchDBs and the master couchDB.

我相信这会导致巨大的瓶颈。有没有更好的方法来解决此问题?

I believe this can lead to a huge bottleneck. Is there a better way to approach this problem?

推荐答案

您是对的:CouchDB的db-per-user模式可以遇到可扩展性问题。这与CouchDB复制器将难以为要处理的同时复制作业的数量提供服务有关。如果您知道用户数量会随着时间的推移而增长,则值得考虑将许多用户数据多路复用到单个(或少数几个)数据库中的体系结构。

You’re right: the db-per-user pattern for CouchDB can run into scalability issues. This is to do with the fact that the CouchDB replicator will struggle to service the number of simultaneous replication jobs it is asked to handle. If you know that your user numbers will grow over time it’s worth considering architectures that multiplex many users’ data into a single (or a handful) database.

复制比较麻烦,因为CouchDB仅对每个数据库进行身份验证,您可能最终需要在它们之间进行另一层操作来解决此问题。

This makes authentication and replication trickier, as CouchDB authenticates per database only, and you may end up with another layer in between to resolve this.

一种方法是使用复制代理,例如< a href = https://github.com/cloudant-labs/envoy/blob/master/README.md rel = nofollow noreferrer> Cloudant Envoy ,它使您的PouchDB应用程序保持不变-模型在客户端,仍然是每用户db,但实际写入到单个DB服务器端。这也意味着您可以避免将服务器端复制到单个主数据库中,因为您已经在主Envoy数据库中拥有了。

One approach is to use a replication proxy such as Cloudant Envoy, which lets your PouchDB applications remain unchanged — the model on the client side is still "db-per-user", but the actual writes go to a single DB server side. This also means that you may be able to avoid the server side replication into a single master DB as you already have that in the main Envoy DB.

免责声明:特使的作者之一。

Disclaimer: I’m one of the authors of Envoy.

这篇关于具有共享数据可伸缩性的CouchDB每用户数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆