Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 70493 invoked from network); 13 Aug 2010 13:31:13 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Aug 2010 13:31:13 -0000 Received: (qmail 49602 invoked by uid 500); 13 Aug 2010 13:31:12 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 49224 invoked by uid 500); 13 Aug 2010 13:31: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 49215 invoked by uid 99); 13 Aug 2010 13:31:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Aug 2010 13:31:07 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.160.180] (HELO mail-gy0-f180.google.com) (209.85.160.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Aug 2010 13:31:01 +0000 Received: by gye5 with SMTP id 5so1454472gye.11 for ; Fri, 13 Aug 2010 06:30:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.139.21 with SMTP id m21mr2128945ybd.80.1281706239262; Fri, 13 Aug 2010 06:30:39 -0700 (PDT) Received: by 10.150.134.10 with HTTP; Fri, 13 Aug 2010 06:30:39 -0700 (PDT) In-Reply-To: <8CD08B4D1C3F27B-1B48-30B@webmail-m007.sysops.aol.com> References: <8CD08B4D1C3F27B-1B48-30B@webmail-m007.sysops.aol.com> Date: Fri, 13 Aug 2010 06:30:39 -0700 Message-ID: Subject: Re: couchdb for aggregating data From: Kenneth Tyler To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Dan, I assume that what each person eats does not change after the record is created. Say you had documents that were recipes, which had lists of nutrients. Then a meal document would have a list of recipes, but it would also have the totals for all the nutrients in all the recipies. A persons day document would combine the information about the person and names of the meals they received and totals for the nutrients. This is a calculate as you go strategy... that trades off data storage space for complexity. It makes the set of person-day documents more like something you'd find in a datawarehousing setup ken tyler On Thu, Aug 12, 2010 at 9:12 PM, wrote: > I just wanted opinions on a site I'm building that converts meals into overall nutrition statistics. > Currently it's in mysql and php. > > It tracks what people eat and breaks it down into nutrients as follows. > Each meal is composed of recipes which are composed of foods -- like a burger is beef, pickles, bun, catsup, mayo, etc. > Each food has 150 nutrients associated with it. > So for each person's day it's got to go ,meals-recipes-foods-nutrients then output a total of each of 150 nutrients in the USDA database. > > Right now we are running into major problems querying the data for more than 200 days. The mysql query is almost unreadable. > > Would couchdb offer advantages for this sort of database problem? > > Thanks for any opinions. > > Dan > > > > > > > >