Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A061E1133D for ; Wed, 9 Apr 2014 16:47:28 +0000 (UTC) Received: (qmail 19325 invoked by uid 500); 9 Apr 2014 16:47:27 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 18666 invoked by uid 500); 9 Apr 2014 16:47:26 -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 18656 invoked by uid 99); 9 Apr 2014 16:47:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Apr 2014 16:47:25 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jens@couchbase.com designates 199.193.200.196 as permitted sender) Received: from [199.193.200.196] (HELO hub029-VA-5.exch029.serverdata.net) (199.193.200.196) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Apr 2014 16:47:18 +0000 Received: from [10.17.31.9] (12.218.209.66) by east.exch029.serverdata.net (10.216.105.43) with Microsoft SMTP Server (TLS) id 14.3.174.1; Wed, 9 Apr 2014 09:46:56 -0700 Content-Type: text/plain; charset="windows-1252" MIME-Version: 1.0 (Mac OS X Mail 7.3 \(1877.7\)) Subject: Re: Would this be a sane use case for couchdb? From: Jens Alfke In-Reply-To: Date: Wed, 9 Apr 2014 09:23:43 -0700 Content-Transfer-Encoding: quoted-printable Message-ID: <4D6E8FCA-A2F4-49D2-A489-8DC7A87DC9C2@couchbase.com> References: To: X-Mailer: Apple Mail (2.1877.7) X-Virus-Checked: Checked by ClamAV on apache.org On Apr 8, 2014, at 11:45 AM, Der Engel wrote: > The webapp is going to be a invoicing software for certain niche, so = I > guess I probably need a DB were transactions are reliable and data > integrity is very good. CouchDB doesn=92t offer transactions, at least not in a traditional = sense. While updating a document is atomic, updating multiple documents = is not; essentially each document update is its own little transaction. = (Even if you use the _bulk_docs command.) If you can accept that, data integrity is great. The append-only file = format is almost immune to corruption, and databases are very easy to = back up efficiently (via replication.) The MVCC feature prevents you = from accidentally overwriting the wrong version of a document, or from = doing a read-edit-write cycle that smashes someone else=92s intervening = write. The lack of transactions may seem bad, but often it just requires = thinking different[ly] about your data. In a document database you can = aggressively *de*normalize by storing multiple small data items inside a = single document, instead of in separate tables =97 a canonical example = is an address card doc that stores arrays of phone numbers and emails. = Such a document will always be internally consistent. It=92s also = possible to create a pseudo transaction as a document that contains a = list of the IDs other documents and revisions that are collectively = consistent. Anyway, if you do get to clustering with any database, you=92ll probably = find that you have to lower your standards about transactions anyway. = Clustered databases mostly respond to the constraints imposed by the CAP = Theorem by relaxing Consistency. Those that don=92t (by using shared = locks) will instead suffer from lowered Availability or = Partition-tolerance. =97Jens=