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 394B3D025 for ; Fri, 2 Nov 2012 17:01:47 +0000 (UTC) Received: (qmail 72075 invoked by uid 500); 2 Nov 2012 17:01:45 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 71982 invoked by uid 500); 2 Nov 2012 17:01: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 71974 invoked by uid 99); 2 Nov 2012 17:01:45 -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 17:01:45 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 209.85.223.180 is neither permitted nor denied by domain of erik@defunweb.com) Received: from [209.85.223.180] (HELO mail-ie0-f180.google.com) (209.85.223.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2012 17:01:36 +0000 Received: by mail-ie0-f180.google.com with SMTP id e10so5140623iej.11 for ; Fri, 02 Nov 2012 10:01:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type:x-gm-message-state; bh=Mz3v4JPhqBtNjEhwTapGQ0IpSNQ+Wn/FiECIaTk+hpc=; b=he1M5SUD9yyP8QHDUxmvJX00jCqXL/nDeuVPkP//GSg3A1CSgJLS8cKpGqgGQ3ztit gHmsHjoqXySBXBc7O3YFImUJ4fWGrQPaf3lLi+G9KQJlP5/JCyYKOHhqZJ+8ahOQrD0k I+8ag2GvjSyCjUcj2PRPHURV4UD5c7TYpGOkSpnNWD1gzQ2d8BU8cXAcFnOQOzPCPslt xwpvbmEa4nkmtDim9ZLOaMZcw4vY392ASdAKX4e7vgtpUm1Qo9YEJwjBSD8EP2F2xkJk rM+zIFKCp3P3US91+d0taIN9QIXfCXdmleB7yKuQIpCXCwZlL+FK4oUFfUVO0D1A19+y +VwA== MIME-Version: 1.0 Received: by 10.50.47.234 with SMTP id g10mr2373738ign.16.1351875673608; Fri, 02 Nov 2012 10:01:13 -0700 (PDT) Received: by 10.64.30.195 with HTTP; Fri, 2 Nov 2012 10:01:13 -0700 (PDT) X-Originating-IP: [99.99.32.251] In-Reply-To: <20121102125801.376ef132@eee-az> References: <20121102125801.376ef132@eee-az> Date: Fri, 2 Nov 2012 10:01:13 -0700 Message-ID: Subject: Re: how do u handle "schema" changes ? From: Erik Pearson To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmqh1j3IEIwT1ivPXj6Db7HUYojO7G39/WhmnftWlUJKZ0CCFHeEP3J+KnRApaGoA1ejFX0 X-Virus-Checked: Checked by ClamAV on apache.org > i know it may sound self-contradictory for couchdb being schemaless .. > > but documents that go into it do have structure/schema. > And once that changes - simplest example being renaming of some field - > what's the recipe? > i know it all from the sql land, but this is different. > > update the documents ? > or make all code - both outside and inside couchdb (views etc) - > accept/handle both old and new? > > i guess the answer is "it depends", still, any suggestions? I think this is it -- there are so many use cases it is very difficult to generalize. E.g. one area I've struggled with is that large collections -- millions of documents -- introduce significant time constraints for rebuilding view indexes. Changing the "schema" of these documents is not really healthy for a live system. There are several strategies for dealing with just this one use case, and they depend on things like data usage patterns. I've also found that there are significant issues with dependencies between the document structure and other server or client software. These dependencies argue for modification off-line, and simultaneous launch of database, server, and client code. Still, I find that the flexibility of free-form documents, run-time availability of a system even under reindexing, and ease of replication and synchronization make the process of couchdb changes much more tolerable and maleable than sql relational databases. I don't have experience with json schema per se, but I have a feeling that something like it will be important to formalizing the process of document database integrity and evolution. It does seem a bit contrary in these early days of document databases to think of tying documents to scheme definitions (yuck, starts to be all xml-ish), but it does seem like a natural progression for both ensuring database longevity as well as other areas like data sharing and archiving. Cheers, Erik. > > ciao > svilen