From user-return-22694-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Nov 2 12:33:37 2012 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 43FD3D7CE for ; Fri, 2 Nov 2012 12:33:37 +0000 (UTC) Received: (qmail 96726 invoked by uid 500); 2 Nov 2012 12:33:35 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 96646 invoked by uid 500); 2 Nov 2012 12:33:35 -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 96616 invoked by uid 99); 2 Nov 2012 12:33:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2012 12:33:34 +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 (nike.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; Fri, 02 Nov 2012 12:33:25 +0000 Received: from [78.83.28.88] (port=57648 helo=eee-az) by mail.open.bg with esmtpsa (Cipher SSL3.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.77) id 1TUGQp-0004Tz-Kr by authid with login for ; Fri, 02 Nov 2012 14:33:03 +0200 Date: Fri, 2 Nov 2012 14:35:47 +0200 From: svilen To: user@couchdb.apache.org Subject: Re: how do u handle "schema" changes ? Message-ID: <20121102143547.42be8ed1@eee-az> In-Reply-To: <9bd986306002eb9344da01796107276d.squirrel@imap.zedeler.dk> References: <20121102125801.376ef132@eee-az> <9bd986306002eb9344da01796107276d.squirrel@imap.zedeler.dk> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; i486-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 > > And once that changes - simplest example being renaming of some > > field - what's the recipe? > > Our recipe is a small script that iterates over every document in the > database that modifies it to comply with the new schema. We do this as > part of upgrading the system living on top of CouchDB. > > Besides this, we have a single document containing the schema version > and some status fields indicating if an upgrade is running or if it > has been run failed. this is fine and would work if all instances of the system on top are of same version - or there is just single instance. but with replication and all the distributed possibilities (think phones etc).. another approach might be needed. Maybe allow multiple schemas to co-exist.. somehow. Seems it becomes a question of schema being the protocol, and if/how multiple variants of that can live together. And/Or considering very hard whether a schema is futureproof enough before publishing the software using it.. hmmm ciao svilen