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 E940D10F6C for ; Sun, 10 Nov 2013 22:01:42 +0000 (UTC) Received: (qmail 30747 invoked by uid 500); 10 Nov 2013 22:01:41 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 30707 invoked by uid 500); 10 Nov 2013 22:01:41 -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 30699 invoked by uid 99); 10 Nov 2013 22:01:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Nov 2013 22:01:41 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mmarino@gmail.com designates 209.85.212.174 as permitted sender) Received: from [209.85.212.174] (HELO mail-wi0-f174.google.com) (209.85.212.174) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Nov 2013 22:01:37 +0000 Received: by mail-wi0-f174.google.com with SMTP id cb5so1434418wib.13 for ; Sun, 10 Nov 2013 14:01:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=qPjUslJYQIeOiOQ/ALpX1l0W36AYtaVJlliCksMZ72k=; b=xwUCKECEheaKAH54+rFD1r+Qw8aIr4qkyQhz+YHUHbns93A7XA0Njmdh8dizYOZb9g UW1ptLRFjzfsmtlqp+VTjNQNupMe1odlvF/wPId06o2l1K/T9kQ5mEDb5NSSzFzE+Vcy hU975qCj6ca9VD3rL3NkUS//xQD+vKDG+3IkQPZ7o+Mfrl68q26Rv9fFheugSJzX5g4b SehFM+9JcTKht+w0MiiV3y279/nXL18AmshuX8UpcjXRUF5pxF26ebNQyOmeH/ku3Q5N p8n3wCnoI3GeLcPM6qSwWY7s25apVoWtlyb5+lUfnA23HB3qlVyM67oLek4RGOZC8GUY u0kw== X-Received: by 10.181.12.75 with SMTP id eo11mr6064112wid.37.1384120876474; Sun, 10 Nov 2013 14:01:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.133.161 with HTTP; Sun, 10 Nov 2013 14:00:56 -0800 (PST) In-Reply-To: References: <527E548F.4020203@yandex.ru> <1CD5C733-4854-407A-A8DF-8E29A1A0493B@couchbase.com> From: Mike Marino Date: Sun, 10 Nov 2013 23:00:56 +0100 Message-ID: Subject: Re: Storage limitations? To: "user@couchdb.apache.org" Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi Mark, On Sun, Nov 10, 2013 at 10:10 PM, Mark Deibert wro= te: > Each comment is normally a very small amount of information, and id, > userName, a date and a small text field. Probably no more than a short > sentence on average. Why do I need to go through the trouble of creating > new comment docs for each? This totally complicates the comment read code > (there will 1000 reads to every 1 write, at least) both in the UI and the > db for no reason. I'm not sure why this should complicate the comment read code. You can generate a view that emits as key the particular page/post to which the comment refers. As value, you can emit either a subset of data you need from the comment, or simply emit "null" and call the view with include_docs to get all the documents for the particular post. This would be a single http call. Cheers, Mike > > > On Sun, Nov 10, 2013 at 1:34 PM, Jens Alfke wrote: > >> >> On Nov 9, 2013, at 11:47 AM, Robert Newson > rnewson@apache.org>> wrote: >> >> attachments are different to documents. They're stored as a series of >> binary chunks and so they can be streamed in and out, you can go large >> with attachments. >> >> But on the other hand, all attachments will get copied during a database >> compaction, so they slow down the process and require more free disk spa= ce. >> If you have many gigabytes of attachments, you might consider storing th= em >> externally and putting URL links in the documents. >> >> As for comments, just add new documents for each comment and use a >> view (https://wiki.apache.org/couchdb/HTTP_view_API, >> https://wiki.apache.org/couchdb/View_collation) to bring the article >> and comment thread together. No need to update a document that way. >> >> Yup. The guide > has a >> chapter-long example of a blog application that shows how to do comments >> this way. >> >> =97Jens >>