Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 16207 invoked from network); 23 Mar 2011 21:45:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Mar 2011 21:45:00 -0000 Received: (qmail 30121 invoked by uid 500); 23 Mar 2011 21:44:58 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 30089 invoked by uid 500); 23 Mar 2011 21:44:58 -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 30081 invoked by uid 99); 23 Mar 2011 21:44:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Mar 2011 21:44:58 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [74.125.83.52] (HELO mail-gw0-f52.google.com) (74.125.83.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Mar 2011 21:44:53 +0000 Received: by gwj15 with SMTP id 15so4986657gwj.11 for ; Wed, 23 Mar 2011 14:44:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.125.167 with SMTP id z27mr9717228yhh.158.1300916671887; Wed, 23 Mar 2011 14:44:31 -0700 (PDT) Received: by 10.236.109.148 with HTTP; Wed, 23 Mar 2011 14:44:31 -0700 (PDT) X-Originating-IP: [125.236.236.206] In-Reply-To: <53410712-5299-43D7-9AAD-578779BCC881@me.com> References: <1300861645.89657.ezmlm@couchdb.apache.org> <53410712-5299-43D7-9AAD-578779BCC881@me.com> Date: Thu, 24 Mar 2011 10:44:31 +1300 Message-ID: Subject: Re: Re: Cross/Joined Database Access? From: Dave Cottlehuber To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 On 23 March 2011 20:47, Marc Schwering wrote: > So there is no way to span queries along multiple connections right? I thought there might be a solution using the replication / sharding features of couch? > > Am 22.03.2011 um 12:26 schrieb dominic.tarr@gmail.com: >> >> you would have to do multiple http requests, i think. >> >> would it be possible to combine all of the dbs into one database and just >> have a field = user1,user2 etc? This is very common - see http://guide.couchdb.org/draft/views.html#comments and the nice picture below it for an example. >> somethings like this seem weird, coming from relational databases, but thats >> couchdb. >> >> On Tue, Mar 22, 2011 at 9:02 PM, Marc Schwering wrote: >> >>> Hi there. >>> >>> Is it possible // How do i Search on multiple Databases? >>> >>> Given one Layout/Schema of Entities: >>> Postings => id; title; content; timestamp >>> >>> This Schema exists due multiple instances of one Application (for different >>> Users) on n Databases. Like: db1,db2,db3 >>> >>> I want to do two fetches: >>> >>> a) all Posts since time X until Y sorted by timestamp. from db1 & db3. >>> b) all Posts since time X until Y sorted by timestamp. from db2 & db3. >>> >>> Is that possible? If so, how? >>> >>> Thanks in advance >>> >>> Marc >>> >>> -- >>> M.Schwering Long story short if this is a critical requirement for your app, it may make more sense to keep all data in a single DB, and use validation functions, replication filters, and either duck typing or tagging to ensure you know who "owns" or can access each doc. If you *need* to keep data private, another workaround is to use multiple couches: one db per user, private - they would replicate / talk to only this personal DB. have one-way replication from each per-user db to a larger DB which consolidates all user data, excluding any private stuff where necessary. run your spanning queries from this DB. optionally use client-side code to pull in any private data from the person's private DB. for time-bound queries, try something like emitting an array of JSON { "year": "2001", "month" and ensure you use http://guide.couchdb.org/draft/recipes.html#fast more info on your app might help give a better answer. A+ Dave