Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7F697D43E for ; Thu, 6 Sep 2012 23:05:59 +0000 (UTC) Received: (qmail 67910 invoked by uid 500); 6 Sep 2012 23:05:58 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 67835 invoked by uid 500); 6 Sep 2012 23:05:57 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 67825 invoked by uid 99); 6 Sep 2012 23:05:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2012 23:05:57 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jens@couchbase.com designates 206.225.164.28 as permitted sender) Received: from [206.225.164.28] (HELO EXHUB020-1.exch020.serverdata.net) (206.225.164.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2012 23:05:51 +0000 Received: from EXVMBX020-1.exch020.serverdata.net ([169.254.4.4]) by EXHUB020-1.exch020.serverdata.net ([206.225.164.28]) with mapi; Thu, 6 Sep 2012 16:05:28 -0700 From: Jens Alfke To: "user@couchdb.apache.org" Date: Thu, 6 Sep 2012 16:05:27 -0700 Subject: Re: App layer on top of replication Thread-Topic: App layer on top of replication Thread-Index: Ac2MhBsa29lnWi5+RKOAahyy0TZmOw== Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_D54EAEA18E764739A2ED8DF6FE9AFC74couchbasecom_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_D54EAEA18E764739A2ED8DF6FE9AFC74couchbasecom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable On Sep 6, 2012, at 1:41 PM, Eduardo Scoz > wrote: My idea is to put CouchDB behind something like Nginx or NodeJS that would intercept direct calls to the database, but still let replication work (as described above). all_docs replication would also have to be disabled, I guess. What makes this tricky is that document contents leak out through other API= calls besides direct GETs of a doc URL. For instance, you can look at all = documents by getting the _changes feed or _all_docs, and of course querying= views. Your proxy layer would have to be aware of these =97 for example it= would have to block any requests for _changes unless they specified a filt= er that restricted the results to docs that user can see (or maybe it could= rewrite the URL to add such a filter?) I think this is do-able but it=92s the sort of thing where I=92d worry that= someone will come up with some creative use of the API to get around it. A proposed solution by the couchbase guys is to have multiple databases, one for each user, and then use replication to share the data, but this seems unmanageable to me once you get thousands of users syncing docs around. It depends on your data model. At one extreme, if users=92 data is entirely= private, the user databases will all be independent and there=92s no overh= ead. How much data is shared between your users? =97Jens --_000_D54EAEA18E764739A2ED8DF6FE9AFC74couchbasecom_--