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 DFB4A4A00 for ; Sun, 10 Jul 2011 00:00:41 +0000 (UTC) Received: (qmail 54069 invoked by uid 500); 10 Jul 2011 00:00:39 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 54020 invoked by uid 500); 10 Jul 2011 00:00:39 -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 54012 invoked by uid 99); 10 Jul 2011 00:00:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Jul 2011 00:00:38 +0000 X-ASF-Spam-Status: No, hits=0.3 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL,TO_NO_BRKTS_PCNT X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.214.52] (HELO mail-bw0-f52.google.com) (209.85.214.52) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Jul 2011 00:00:32 +0000 Received: by bwj24 with SMTP id 24so3780035bwj.11 for ; Sat, 09 Jul 2011 17:00:11 -0700 (PDT) Received: by 10.204.24.68 with SMTP id u4mr1954637bkb.12.1310256011218; Sat, 09 Jul 2011 17:00:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.3.138 with HTTP; Sat, 9 Jul 2011 16:59:51 -0700 (PDT) In-Reply-To: References: From: Mark Hahn Date: Sat, 9 Jul 2011 16:59:51 -0700 Message-ID: Subject: Re: RESTful document structure To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org In that case, if you say that by definition all docs in one app are related, then there should be one database, but different design docs for performance. What is the utility of having multiple views in one design doc, other than being able to edit them in one place? Or another way to phrase the same question: why do design docs exist? On Sat, Jul 9, 2011 at 1:44 PM, Robert Newson wrote: > That's not quite accurate. All views inside the same design document > are written to the same file and so we update them all at once, but > each design document can build its views independently. The pivot > point for view build parallelism is the design document, not the > database. > > Keeping unrelated documents in different databases is just another way > of saying keep related documents in the same database, which is sane. > > B. > > On 9 July 2011 21:37, Mark Hahn wrote: >> However, the more views, designs, etc. you put in a single db the >> slower some operations, like updating a view, get. =A0I tend to use >> different DBs when I know the data has no inter-connections and has no >> reason to be combined. =A0It also feels good to have independent dbs >> when used by independent modules. >> >> The only negative I can think of is having more dbs to manage in >> operations like replication, but that is just bookkeeping. >> >> On Sat, Jul 9, 2011 at 1:29 PM, Robert Newson wrote= : >>> In CouchDB, most of the important features are scoped at the database >>> level. For example, views, replication, validation functions, rewrite >>> rules and _security objects. Separating data into different databases >>> by type would remove access to almost all the compelling features of >>> CouchDB, reducing it to a mere document store, not a document >>> database. >>> >>> B. >>> >>> On 9 July 2011 21:19, Keith Gable wrote: >>>> REST is more concerned with verbs and resources and what happens when = you >>>> combine the two. >>>> >>>> The OP is more than welcome to use different databases for each distin= ct >>>> type of data, however it makes it more difficult to do stuff and is >>>> certainly not necessary. >>>> >>>> If you think about a CouchDB document as a resource within a collectio= n that >>>> is your database, it makes sense. VERB /database-collection/document. >>>> Perfectly RESTful to me. >>>> >>>> On Sat, Jul 9, 2011 at 2:35 PM, Robert Newson wro= te: >>>> >>>>> REST does not require that you use only one type of document per >>>>> database. Even if it did, I'd strongly advise violating a rule as >>>>> silly as that. >>>>> >>>>> Put whatever documents into your database as you please. >>>>> >>>>> B. >>>>> >>>>> On 9 July 2011 19:39, Johnny Weng Luu wro= te: >>>>> > Since CouchDB is implementing a RESTful API, doesn't that mean I wa= nna >>>>> put >>>>> > all documents of the same type in their own database? >>>>> > >>>>> > eg. >>>>> > >>>>> > POST http://localhost/users >>>>> > GET http://localhost/users/1 >>>>> > PUT http://localhost/users/1 >>>>> > DELETE http://localhost/users/1 >>>>> > >>>>> > POST http://localhost/threads >>>>> > GET http://localhost/threads/1 >>>>> > PUT http://localhost/threads/1 >>>>> > DELETE http://localhost/threads/1 >>>>> > >>>>> > Rather than putting them all in one big database ( >>>>> http://localhost/my_app). >>>>> > >>>>> > Doesn't a 100% RESTful approach mean that the former is more correc= t? >>>>> > >>>>> >>>> >>>> >>>> >>>> -- >>>> Keith Gable >>>> A+ Certified Professional >>>> Network+ Certified Professional >>>> Web Developer >>>> >>> >> >