Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 28451 invoked from network); 2 Oct 2008 04:07:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Oct 2008 04:07:56 -0000 Received: (qmail 11740 invoked by uid 500); 2 Oct 2008 04:07:54 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 11704 invoked by uid 500); 2 Oct 2008 04:07:54 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 11693 invoked by uid 99); 2 Oct 2008 04:07:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Oct 2008 21:07:54 -0700 X-ASF-Spam-Status: No, hits=2.1 required=10.0 tests=DNS_FROM_RFC_BOGUSMX,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ben@groovie.org designates 85.10.207.234 as permitted sender) Received: from [85.10.207.234] (HELO unicron.groovie.org) (85.10.207.234) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Oct 2008 04:06:52 +0000 Received: from c-71-202-164-208.hsd1.ca.comcast.net ([71.202.164.208] helo=Shaggy.home.groovie.org) by unicron.groovie.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1KlFTI-0003yP-B8 for couchdb-user@incubator.apache.org; Wed, 01 Oct 2008 21:07:25 -0700 Message-Id: <2C17E6E1-5B77-40DA-800A-74A7E374D673@groovie.org> From: Ben Bangert To: couchdb-user@incubator.apache.org In-Reply-To: Content-Type: multipart/signed; boundary=Apple-Mail-21--199913889; micalg=sha1; protocol="application/pkcs7-signature" Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: Associating users and comments Date: Wed, 1 Oct 2008 21:07:01 -0700 References: <2098F155-ECB7-468E-8CA7-8E54F18EE606@groovie.org> <5152C024-ACC0-4FF7-AB45-171C0B2311EC@groovie.org> <16E99800-645D-4009-B499-7C94D71A4D92@groovie.org> X-Mailer: Apple Mail (2.929.2) X-Spam-Score: -2.6 (--) X-Spam-Report: Spam detection software, running on the system "unicron.groovie.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Oct 1, 2008, at 8:42 PM, Paul Davis wrote: > I think what you're running into is the CouchDB != SQL impedance > mismatch. Its not overt and I see you're thinking about this, but I > still manage to not see my RDBMS prejudices after working on this for > a couple months. [...] Content analysis details: (-2.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.5 DNS_FROM_RFC_BOGUSMX RBL: Envelope sender in bogusmx.rfc-ignorant.org -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] 0.3 AWL AWL: From: address is in the auto white-list X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-21--199913889 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Oct 1, 2008, at 8:42 PM, Paul Davis wrote: > I think what you're running into is the CouchDB != SQL impedance > mismatch. Its not overt and I see you're thinking about this, but I > still manage to not see my RDBMS prejudices after working on this for > a couple months. I'm not a total virgin to non-RDBMS thinking, as I've used XML db's rather heavily, along with Google Datastore. So in an XML db, or even Google Datastore, I'd store all the comments for a post inside the post itself. No worries about conflicts because I can issue multiple updates to the XML document to insert additional comment nodes. As Chris Lenz mentions on his blog about CouchDB, under heavy load you need to keep comments out of the posts due to conflicts when updating the document and sending the update back to the db. So CouchDB is requiring a level of normalization that other document oriented databases do not (since they can update parts of a document without replacing the entire thing). As I'm forced to normalize to an extent in CouchDB due to its inability to update individual keys of a document without replacing the entire thing, it seems odd that its so dang hard to get some data together in a single query. It seems like CouchDB should either grow some scheme to let me get more data from separate related docs in one go, or it should allow for atomic updates of individual parts (or insertions of new keys) on a document without affecting the entire document (and thus causing conflicts and the additional normalization the inability caused). > I see that Chris managed to provide a reduce for the first question > which is good. The second answer is missing part of the question. As > in I think Ben was asking "Give me a list of users and their top 5 > posts" which != "Give me user and top 5 posts". Yes, if I wanted to list 20 users and their last 5 posts, that'd be 20 run-abouts to the db. Granted the views are super fast, but the constant round-trip latency will add-up. > So far I think its clear we need better reduce docs. Also, I'm > thinking tomorrow might be a good day to start thinking about view > intersection/union syntax. Anyone that cares feel free to pipe up on > IRC or the ML. I don't see the implementation being difficult given a > decent method for specifying the sub queries. Yes, that'd definitely help, and more examples of these common things to help others to get their head out of RDBMS-land. ;) Cheers, Ben --Apple-Mail-21--199913889 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGfTCCAzYw ggKfoAMCAQICEClzcfApE1Xl0tE8fQf6InIwDQYJKoZIhvcNAQEFBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA4MDUyMzIyMDUzNVoXDTA5MDUyMzIyMDUz NVowZjEfMB0GA1UEAxMWVGhhd3RlIEZyZWVtYWlsIE1lbWJlcjEjMCEGCSqGSIb3DQEJARYUYmJh bmdlcnRAZ3Jvb3ZpZS5vcmcxHjAcBgkqhkiG9w0BCQEWD2JlbkBncm9vdmllLm9yZzCCASIwDQYJ KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMAxyJSHPp0a6b6jg37ULZHv6Vh+ZthZh0LIACrEkeDU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