Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 70090 invoked from network); 27 Oct 2009 16:35:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Oct 2009 16:35:07 -0000 Received: (qmail 81997 invoked by uid 500); 27 Oct 2009 16:35:05 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 81950 invoked by uid 500); 27 Oct 2009 16:35:05 -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 81933 invoked by uid 99); 27 Oct 2009 16:35:04 -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 16:35:04 +0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [207.97.245.191] (HELO smtp191.iad.emailsrvr.com) (207.97.245.191) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 16:34:56 +0000 Received: from relay9.relay.iad.mlsrvr.com (localhost [127.0.0.1]) by relay9.relay.iad.mlsrvr.com (SMTP Server) with ESMTP id 4CCC91E6254 for ; Tue, 27 Oct 2009 12:34:35 -0400 (EDT) Received: by relay9.relay.iad.mlsrvr.com (Authenticated sender: jim-AT-nhrevolution.com) with ESMTPSA id C98611E6257 for ; Tue, 27 Oct 2009 12:34:34 -0400 (EDT) Message-Id: <54CC6123-B953-4CAB-B05D-D835DAB713DD@nhrevolution.com> From: Jim Kass To: "user@couchdb.apache.org" In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7A400) Mime-Version: 1.0 (iPhone Mail 7A400) Subject: Re: How could I use CouchDB in an e-commerce app? Date: Tue, 27 Oct 2009 09:34:30 -0700 References: <214c385b0910270807o37cccabfy39b000f313175661@mail.gmail.com> <4a29064f0910270850v5222c1ecwd06cd41729ddc69f@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org 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. 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. 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 >>