Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 11615 invoked from network); 11 Nov 2009 04:42:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Nov 2009 04:42:50 -0000 Received: (qmail 3051 invoked by uid 500); 11 Nov 2009 04:42:49 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 2903 invoked by uid 500); 11 Nov 2009 04:42:48 -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 2892 invoked by uid 99); 11 Nov 2009 04:42:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Nov 2009 04:42:47 +0000 X-ASF-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,FS_REPLICA,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jwriteclub@gmail.com designates 209.85.223.184 as permitted sender) Received: from [209.85.223.184] (HELO mail-iw0-f184.google.com) (209.85.223.184) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Nov 2009 04:42:44 +0000 Received: by iwn14 with SMTP id 14so672297iwn.13 for ; Tue, 10 Nov 2009 20:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=1F+49PfyM4J87gAcwUeQEK6Z687VUp+ojDfc/EedS3E=; b=uWkQB3gs9eSlI9rpzKUiJgrAfvcfq0kiCbqtvLI09mNOFzCHp/2240kOMbv/5t0qp5 lJxhTAfSDENrueJzzvynaB8eriCh5pxe7GIGSV/RmoxXnO9hD4q2H+GxSa8pfcETn50/ nCm8GMahMT3jmP7mtdSapQQoAjRHFQio7Lk64= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=aVOs6/+vgM0RbEXQQCygp81saModSMmCeZaB6zBk1rw6P8uswOxI0Aqfq30Dg/VdHb 1G9S104jZ0Zg3bwoCTxonbMU3VqhfQaPXpKFp7/TZxhxNgqyJpl2yiTP8js/zOVnN0ap a/jmuaZn0KN7engXldXsn8VMojQtfz90Em8gU= MIME-Version: 1.0 Received: by 10.231.148.135 with SMTP id p7mr1777644ibv.27.1257914544125; Tue, 10 Nov 2009 20:42:24 -0800 (PST) In-Reply-To: References: From: "Christopher O'Connell" Date: Tue, 10 Nov 2009 21:42:04 -0700 Message-ID: <81d01c0911102042l5a05da76rc499b179e0cd98a5@mail.gmail.com> Subject: Re: Question about document copies & replication To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0016e64be2208f88830478110d95 --0016e64be2208f88830478110d95 Content-Type: text/plain; charset=ISO-8859-1 It might make more sense to store a field indicating whether a document is public or private, and then use some software to only replicate public docs. Keeping multiple local copies just seems like a bad plan, and if you want to support two way replications, it will almost certainly run into problems. Indeed, you may want to replicate the whole user database as it is, and simply expose the public documents via a view on the server: Something like function(doc) { if(doc.Visibility == "Public") emit(doc._id,); } Those who really know what they're talking about are welcome to slap me around on this. ~ Christopher On Tue, Nov 10, 2009 at 9:19 PM, David Nolen wrote: > Ok, > > My mind is being blown by CouchDB :D > > So I've realized that having a few databases per user is a really great > idea > if you decide to scale by decentralizing your content (clients do the heavy > lifting by running queries on their local couchdb instances - since you're > replicating to the client you don't really care that a lot of data is > getting copied around). Every user has their own view of the world, and the > server CouchDB instance is really only for dealing with content shared > between users. > > In our application (http://shiftspace.org), I'm thinking something along > these lines: > > Client's laptop CouchDB instance: > user/private - all the documents a user has created plus replicated content > from groups and whatnot > user/public - all the user's public content > user/inbox - short messages > > Server CouchDB instance: > group/x - group dbs of shared content. Replicated downstream to individual > user/private who belong to the group > master - user/public dbs replicated upstream to here. > > So my question is this. When a user publishes a document, it is written to > user/private. If the user publishes a document to the world, we make a copy > of it in user/public - it's just the same data minus the _rev field. > Whenever a user updates a public document, we update the user/private copy > as well as the the user/public copy which will be replicated upstream to > the > server. > > So my question for the CouchDB gurus, will creating copies of documents in > this manner create potential problems? > > Thanks much, > David > --0016e64be2208f88830478110d95--