From user-return-7159-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Tue Oct 27 23:25:54 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 63052 invoked from network); 27 Oct 2009 23:25:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Oct 2009 23:25:54 -0000 Received: (qmail 36109 invoked by uid 500); 27 Oct 2009 23:25:53 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 36018 invoked by uid 500); 27 Oct 2009 23:25:52 -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 36008 invoked by uid 99); 27 Oct 2009 23:25:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 23:25:52 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of pcassiano@gmail.com designates 209.85.223.179 as permitted sender) Received: from [209.85.223.179] (HELO mail-iw0-f179.google.com) (209.85.223.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 23:25:44 +0000 Received: by iwn9 with SMTP id 9so235291iwn.30 for ; Tue, 27 Oct 2009 16:25:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=8Ht+g/4CYW5Nm8m20Sqch0+cnFnsh0UVzoKH15s8RI0=; b=D00SI2yZRtsAw9/YB3cccOSJ5BRj1PiGZcjhlih+uLTbwB1U8Bo7AL/aDXSAKjTgR6 /8ABrP6m0XdRXpCy7Wn6VOEZMEJgTCeHRWKCd4aUwzYVO6I0VWnmzkugUHvKTvtB+5CP MoonuecSAlZWa6Lj62yCub4e204aE0rL912x0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=NGFjYaBeWsu+h2Q93DSzO7z5nKsKXtjLkVZ4cefVTgRJvVHIoIzSESjb/yozmOdtZ1 iIlgipzNah98mLt1GISFv7JKlL9BE8HF6u1x902WMW7iuCwuhRD65FDfGnGcDqv7Byi1 fPGSiFAuf4k1+4ZlUIKr2B+I07Gkfe/dOt5RA= MIME-Version: 1.0 Received: by 10.231.125.19 with SMTP id w19mr1169165ibr.8.1256685922283; Tue, 27 Oct 2009 16:25:22 -0700 (PDT) In-Reply-To: <54CC6123-B953-4CAB-B05D-D835DAB713DD@nhrevolution.com> References: <214c385b0910270807o37cccabfy39b000f313175661@mail.gmail.com> <4a29064f0910270850v5222c1ecwd06cd41729ddc69f@mail.gmail.com> <54CC6123-B953-4CAB-B05D-D835DAB713DD@nhrevolution.com> From: Paulo Cassiano Date: Tue, 27 Oct 2009 21:25:02 -0200 Message-ID: Subject: Re: How could I use CouchDB in an e-commerce app? To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0016e6475b20fe30050476f2fd27 X-Virus-Checked: Checked by ClamAV on apache.org --0016e6475b20fe30050476f2fd27 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Oct 27, 2009 at 2:34 PM, Jim Kass wrote: > Paulo, > > If you are asking can couch be used for transactional systems, such as > banking or payment processing... > > The database itself doesn't have any transactional locking mechanism. > However, as all documents are revisions... You could actually add multiple > documents with a transaction_state field, and then upon completing the > transaction update the transaction_state field in that document. > Thank you. > > Because unlike SQL, there are no joins, foreign key restraints or > cascading, in order to have a transaction that touches many "tables", you > would need to rethink your data model to incorporate nested data structures > in single documents. > I think I need to learn how to model data in the CouchDB way... > > One current deficiency is that you must retrieve documents in order to > modify a field. However this is easily abtracted in a library or class such > that you could use a specified view to extract a subset of documents then > loop through them to update a specified field, then either use bulk function > or another loop to save the new version. > > A function like this in use in psuedocode: > > trans = new CouchTransaction("myTransaction") > trans.start() > // do stuff > trans.add(doc,db) > trans.add(another_doc,another_db) > If (condition) { > trans.commit() > } > trans.end() > > I'm sure others would have better algorithms for what a CouchTransaction > class might involve, but this is off the top of my head. > > HTH, > Jim > > Sent from my iPhone > > > On Oct 27, 2009, at 8:55 AM, Paulo Cassiano wrote: > > I'm totally newbie in CouchDB, but I belive it could be ready for >> production >> use. True. I only was thinking about how could I develop some e-commerce >> app >> using it as DB server... Did you think about it before? >> >> On Tue, Oct 27, 2009 at 1:50 PM, Elf wrote: >> >> Couchdb is ready for production use. >>> >>> 2009/10/27 Paulo Cassiano : >>> >>>> OK, infact, that's could be a much bigger question. >>>> >>>> But I think I'm not the only guy to think about this... If YOU were >>>> asked >>>> >>> to >>> >>>> do this, how did you do? >>>> >>>> On Tue, Oct 27, 2009 at 1:07 PM, Matt Goodall >>> wrote: >>>> >>>> 2009/10/27 Paulo Cassiano : >>>>> >>>>>> Every e-commerce app shows at least one product's picture, along with >>>>>> descriptions and other useful information. Does CouchDB supports >>>>>> >>>>> images - >>> >>>> JPEG, GIF and so on - files? >>>>>> >>>>> >>>>> Each CouchDB doc can have multiple attachments, see >>>>> http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments. >>>>> >>>>> I would say a "product" makes an almost perfect CouchDB document. The >>>>> document itself could contain whatever data the product needed to >>>>> describe it (description, options, price, bulk prices, etc, etc) and >>>>> the images of the product would be its attachments. >>>>> >>>>> >>>>>> How could I use CouchDB in an e-commerce app? >>>>>> >>>>> >>>>> That's a much bigger question ;-). >>>>> >>>>> - Matt >>>>> >>>>> >>>> >>> >>> >>> -- >>> ---------------- >>> Best regards >>> Elf >>> mailto:elf2001@gmail.com >>> >>> --0016e6475b20fe30050476f2fd27--