Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 53315 invoked from network); 27 Dec 2010 11:30:36 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Dec 2010 11:30:36 -0000 Received: (qmail 96318 invoked by uid 500); 27 Dec 2010 11:30:34 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 96088 invoked by uid 500); 27 Dec 2010 11:30:33 -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 96080 invoked by uid 99); 27 Dec 2010 11:30:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Dec 2010 11:30:32 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of djc.ochtman@gmail.com designates 209.85.216.173 as permitted sender) Received: from [209.85.216.173] (HELO mail-qy0-f173.google.com) (209.85.216.173) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Dec 2010 11:30:24 +0000 Received: by qyk1 with SMTP id 1so9591609qyk.11 for ; Mon, 27 Dec 2010 03:30:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:content-type:content-transfer-encoding; bh=E2NCpD4PbvRyM35BtF4zPbjWhsfitt+4FbBZryQwOuM=; b=YDoNhhzVmUDuw98t+ZJFAtY32HNmVAFQ/6tIY0r1zYzYt1x4wW643R2+GiOa0YNWaT qVqxtSbfLP6POkAm1qnrAF0gMvMlj7jfp6OQ90mEbe5lWHr16PeKXep6TWK77YE83qfS Cbue7PKLNJvrZoyRhmx7GacE6mY9CsDrJ7iE0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; b=pJamEsdk7c7X/UubS51Fkeypd0m+1uGdcVlpNzqeTBmnQa5pHp6XQfzO2hba+lc86G WfYHHoT3GFzcFWeV6zuR+ITBu/EhxyEAYCoiMN8EUQGt5mpL3/kQKLFIV/wGxpywvmnA xjogPN9MGjKVM149ZE0PZ4N60925RlBrIyHEs= Received: by 10.229.28.143 with SMTP id m15mr10821313qcc.162.1293449403808; Mon, 27 Dec 2010 03:30:03 -0800 (PST) MIME-Version: 1.0 Sender: djc.ochtman@gmail.com Received: by 10.229.35.16 with HTTP; Mon, 27 Dec 2010 03:29:43 -0800 (PST) In-Reply-To: References: From: Dirkjan Ochtman Date: Mon, 27 Dec 2010 12:29:43 +0100 X-Google-Sender-Auth: UBnE-i2ZJnjPLcxZuafa2qRzwfs Message-ID: Subject: Re: CouchDB Carts and Orders Best Practice To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Mon, Dec 27, 2010 at 12:04, Shenouda Bertel wrote: > =C2=A0 What is the best practice for the carts implementation with CouchD= B, > which save the performance of the application, with less requests to Couc= hDB > and without several saving of the CouchDB Document. I would have a separate document per cart item (i.e. the item has two "foreign keys", pointers to both the user and the product), so you can update each item separately and can use a view to easily retrieve all of the items in the cart, and lets you update the document for each item separately. Cheers, Dirkjan