Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 18631 invoked from network); 13 Apr 2009 11:20:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Apr 2009 11:20:55 -0000 Received: (qmail 82815 invoked by uid 500); 13 Apr 2009 11:20:54 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 82735 invoked by uid 500); 13 Apr 2009 11:20:54 -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 82725 invoked by uid 99); 13 Apr 2009 11:20:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Apr 2009 11:20:54 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bchesneau@gmail.com designates 72.14.220.153 as permitted sender) Received: from [72.14.220.153] (HELO fg-out-1718.google.com) (72.14.220.153) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Apr 2009 11:20:46 +0000 Received: by fg-out-1718.google.com with SMTP id l27so342375fgb.3 for ; Mon, 13 Apr 2009 04:20:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=M4O1gOaabzRpXdreY/axqfGXNzYVAMH/KAxkIB/yQF0=; b=xJ6Rz1lV/2N0ItDgoHrfpaJI5PKD6mimVzRWR7Pb8vBDLO/glS56R51CKLfYpBCIsR nHffcH1gIWHJiwGplHRq4bgdX/xsNcXLj2O/n/naEs7os+agsNC+HIXR7l9D4iJBaxH2 6CA/QfizAVgczu4VgdUqMgaylJDyt1B6Saytw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=v/KmDVltDCK6A7uUjMH1zxd3P/AsQRzeYw5SbZ8982+naF97IVKa4Q3aGqhxC16jBp 9BZtmNxpgZKc3GFVpKv8EwvEdTSxKhXLRjexmLUwIY3zodQFMg7IUf4Qdo+KsRI7nzi6 nc9G3PTZITf0FcHqqImftKgGhQWwPxBbezvDU= MIME-Version: 1.0 Received: by 10.86.93.17 with SMTP id q17mr4650000fgb.75.1239621625177; Mon, 13 Apr 2009 04:20:25 -0700 (PDT) Date: Mon, 13 Apr 2009 13:20:25 +0200 Message-ID: Subject: using external to generate shortid ? From: Benoit Chesneau To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, For some project I need to generate short ids/name used in database. I created a quick external to send shortid on each call. External use an empty doc['shortcode'] which is saved each time the external is called thend send bac the rev stem b62encoded. I then use the shortid across documents. http://www.friendpaste.com/ww5zr0XEK5qxO3mOEeGr3 But I wonder if it's enough to be sure 2 doc don't have same short id for a node. In fact how are handled externals ? Does couchdb open a process each time external is called or does it reuse it ? Does couchdb open one external / guest connected to the db ? I would prefer to store the sort increment in couchdb so I could do backup easyly. What could be the other way to create a short id ? - benoit