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 986A210025 for ; Sun, 10 Nov 2013 22:15:09 +0000 (UTC) Received: (qmail 59375 invoked by uid 500); 10 Nov 2013 22:15:08 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 59336 invoked by uid 500); 10 Nov 2013 22:15:08 -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 59321 invoked by uid 99); 10 Nov 2013 22:15:07 -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:15:07 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mark.deibert@gmail.com designates 209.85.212.42 as permitted sender) Received: from [209.85.212.42] (HELO mail-vb0-f42.google.com) (209.85.212.42) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Nov 2013 22:15:03 +0000 Received: by mail-vb0-f42.google.com with SMTP id p14so2770396vbm.15 for ; Sun, 10 Nov 2013 14:14:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=CIV0ATzd/0yzPl2tga/K/dYTwF4Vp7sN4YhEJSYXnFo=; b=ZPOTqZnNvRb2rzdGFvfYo9Gyhrn9gKAoDtcmRogKHEmJTLF/pHMD2kytYOpjV3sEXu giPRaI/2vBZmpGBa/OJRnm7pspZiLg2DG0klE81BwpR8vHWK2ZQ2/hHAEMYT+OdkI/6i 4EkP2mxNKuWt8KKeh4ZeUW6ppnJOEpKvxgZMeO5755iRopVLD1iNp0USyEVZFvG0DKkR JRaHBpKA/8mRaJ30wUMDlDBoOwLqXTqqlZM0ix4Sg68uB0XXQ36ZDkuSAaMlx4NaLROm eVWFRFIjuVfM8oiYt4fHBzXjsGkC4YxAXGJjqmZeO+7oIvJc3o5cN3Awxi7tVgQUUjJG JzLA== MIME-Version: 1.0 X-Received: by 10.52.26.69 with SMTP id j5mr18185036vdg.21.1384121682413; Sun, 10 Nov 2013 14:14:42 -0800 (PST) Received: by 10.220.198.199 with HTTP; Sun, 10 Nov 2013 14:14:42 -0800 (PST) In-Reply-To: References: <527E548F.4020203@yandex.ru> <1CD5C733-4854-407A-A8DF-8E29A1A0493B@couchbase.com> Date: Sun, 10 Nov 2013 17:14:42 -0500 Message-ID: Subject: Re: Storage limitations? From: Mark Deibert To: "user@couchdb.apache.org" Content-Type: multipart/alternative; boundary=20cf307f324634cd9004ead9f1a3 X-Virus-Checked: Checked by ClamAV on apache.org --20cf307f324634cd9004ead9f1a3 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable I read an article somewhere that using include_docs is "hard" on memory or disk or in some way taxes Couch and therefore you should just emit the doc. Is this true? On Sun, Nov 10, 2013 at 5:11 PM, Mark Deibert wrote= : > BTW, my current code _is_ storing each comment as it's own doc, and I > already _do have_ and am using the view that is being described here. I w= as > just trying to figure out something more denormalized. However, Keith's > comment about the conflicts might be nail. I didn't think about that. > > > On Sun, Nov 10, 2013 at 5:00 PM, Mike Marino wrote: > >> Hi Mark, >> >> On Sun, Nov 10, 2013 at 10:10 PM, Mark Deibert >> wrote: >> > 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 creati= ng >> > 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 larg= e >> >> 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 >> space. >> >> If you have many gigabytes of attachments, you might consider storing >> them >> >> 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 >> >> >> > > --20cf307f324634cd9004ead9f1a3--