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 DDF4FEEC1 for ; Wed, 13 Feb 2013 15:48:21 +0000 (UTC) Received: (qmail 63162 invoked by uid 500); 13 Feb 2013 15:48:20 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 63025 invoked by uid 500); 13 Feb 2013 15:48:19 -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 62844 invoked by uid 99); 13 Feb 2013 15:48:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Feb 2013 15:48:18 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kxepal@gmail.com designates 74.125.82.48 as permitted sender) Received: from [74.125.82.48] (HELO mail-wg0-f48.google.com) (74.125.82.48) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Feb 2013 15:48:13 +0000 Received: by mail-wg0-f48.google.com with SMTP id 16so1063390wgi.3 for ; Wed, 13 Feb 2013 07:47:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=19OxmVLSnN/opx+YFoW3Pl32y9hEHTOW/eojU7u/ZRY=; b=OeFjLQR3pQVRLaqvH5TJcTm1yY1UkJh4HjXEvfuWlWFmeNMaFGWHMqFPp6LccBoF/P 24HOKlZqsYO4GqPHATErhbIxiUjIXY2sMAb3xtvkZ3quLjnebdhcAaZKgWe98JosFvtQ zq6qwbycEUAVVIq1gF4F3bun3zHmOSEntEDyRF8+eY/w/sQhn7rIU9qr5uMORc+YMWUO 38RawyBh2CP0FvAU4smtWSeuvIQ3laqtFUbDtF3/DuspoPoyyccB96DU1lW+ziUdnQBx FTQ6QXALie45/gU0gRvHS6FWdK0grbBMdwQafvwuayN4SB79FT3NqmgP5UulEHFUmKAc Lv6A== MIME-Version: 1.0 X-Received: by 10.180.14.166 with SMTP id q6mr11044622wic.22.1360770472365; Wed, 13 Feb 2013 07:47:52 -0800 (PST) Received: by 10.180.86.225 with HTTP; Wed, 13 Feb 2013 07:47:52 -0800 (PST) In-Reply-To: References: Date: Wed, 13 Feb 2013 18:47:52 +0300 Message-ID: Subject: Re: I've just released a first preview of couch_normalizer From: Alexander Shorin To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org That is awesome, Alex! This is the thing I always dream when our document schemes receives new update and there is need to apply they for large amount of databases. Trick with local database mirror and replications works, but it's not very fast. Few questions: 1. What happens it normalization fails due to some reasons? For example, due to conflict update. Have I start whole normalization again in this case or it will just write few notes about conflict in logs and will try apply script to document one more time? 2. Is it possible to receive final result of the normalization job and error description if it fails? Continuous querying _active_tasks looks not optimal and it's possible to miss the moment when normalization fails. 3. Only Erlang and Elixir migration scripts are possible, right? Or it's possible to use any scripts that supports CouchDB stdio communication protocol? I suppose many of us who faced same problem already have Python/Ruby/whatever-lang scripts that successfully handles scheme normalization and well tested. It would be helpful to not force them made whole job again. -- ,,,^..^,,, On Wed, Feb 13, 2013 at 7:04 PM, =D0=90=D0=BB=D0=B5=D0=BA=D1=81 Zatvornitsk= iy wrote: > Hi everybody! > > A couch_normalizer v0.6 is out! > > The couch_normalizer designed as a standard Apache CouchDB httpd handler > and uses a Rails db migration approach. Written both in Erlang and Elixir= . > Works well on production and has a great IO performance. > > For example: > > % Starts a normalization process. > > % curl -v -XPOST -H"Content-Type: application/json" > http://127.0.0.1:5984/db/_normalize > > % =3D> {"ok":"Normalization process has been started (<0.174.0>)."} > > > % Gets a normalization process execution status. > > % curl -v http://127.0.0.1:5984/_active_tasks > > % =3D> > [{"pid":"<0.174.0>","continue":false,"db":"db","docs_conflicted":0,"docs_= deleted":0,"docs_normalized":0,"docs_read":3000,"finished_on":1358513508,"n= um_workers":5,"started_on":1358513508,"type":"normalization","updated_on":1= 358513508}] > > As a result, it allows to deploy migration scripts (aka scenarios) and > change big amount of documents as fast as possible (without HTTP overhead > and some kind of 'delayed jobs') via internal CouchDB functions, such as > couch_db:open_doc/2, couch_db:update_doc/3 and so on. > > Check more: https://github.com/datahogs/couch_normalizer > > If you want to contribute, feel free to open an Github issue or submit a > pull request or ping me offline) > > It still under scoping and development.