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 1D25FFDAD for ; Thu, 9 May 2013 20:32:47 +0000 (UTC) Received: (qmail 31377 invoked by uid 500); 9 May 2013 20:32:45 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 31342 invoked by uid 500); 9 May 2013 20:32:45 -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 31332 invoked by uid 99); 9 May 2013 20:32:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 May 2013 20:32:45 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [91.195.24.3] (HELO mail.open.bg) (91.195.24.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 May 2013 20:32:39 +0000 Received: from [78.83.22.128] (port=59022 helo=localhost.localdomain) by mail.open.bg with esmtpsa (Cipher SSL3.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) id 1UaXVg-0001TU-W8 by authid with login for ; Thu, 09 May 2013 23:32:17 +0300 Date: Thu, 9 May 2013 23:32:15 +0300 From: svilen To: user@couchdb.apache.org Subject: Re: Mass updates Message-ID: <20130509233215.0f6c86cf@svilendobrev.com> In-Reply-To: <518C0216.9000607@apache.org> References: <518B16F5.2040306@alumni.gwu.edu> <8471588272415020431@unknownmsgid> <20130509155252.74edbd0e@svilendobrev.com> <518C0216.9000607@apache.org> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.16; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org yeah i know. i've been through it, needing temporaly-versioned code stored in a db, apart of the data for that time-period.. i know what it is. Near to impossible - still, it's the only correct one. > Ideally, there would be some robust extension to couchdb to handle > schema changes for large online databases in a sane way. btw i read that something like virtual views is going to be made.. one that would help multi-pass queries (which now are made just via artificial temporary dbs). Maybe these multi-version schemas are kind of that.. On Thu, 09 May 2013 13:07:50 -0700 Wendall Cada wrote: > On 05/09/2013 05:52 AM, svilen wrote: > >>>>>> The main concern I have is maintaining a consistent state > >>>>>> across code releases. Presumably, our data model will change > >>>>>> over the course of time, and when it does, we need to make the > >>>>>> several million old documents conform to the new model. > > a question: do u need to keep the old variant/state too? > > (think bi-temporal stuff) > > > > that one, and if the once-off conversion process is going to take > > loooong time, it might be better to bite the bullet and allow for > > multiple (e.g. 2) versions of the "schema" to coexist - in both > > server/views and client code. Thus once u already have some doc in > > the new variant, use it. Else, fallback to runtime-conversion. > > > > i know it isn't easy to organise but otherwise u're fighting > > reality. > > > > svilen > > This may sound ideal, but in my experience, this can lead to crazy, > buggy, eventually un-maintainable code. Additionally, this approach > ends up quickly in a situation where you're not supporting just two > schemas, but multiple others as well, as you can never guarantee that > the schema was updated across the entire database. > > This has been discussed at my workplace quite extensively recently. > Ideally, there would be some robust extension to couchdb to handle > schema changes for large online databases in a sane way. > > The real issue here isn't updating the schema in the db docs, it's > updating the schema and the requisite view indexes. If the schema > changes break your ddoc code, there isn't any live db solution > available that can fix this issue. This part of any database > maintenance is really, really hard work. It's what DBAs do for a > living, and is just difficult in different ways depending on the > database. > > Wendall