Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 38792 invoked from network); 25 Aug 2009 18:17:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Aug 2009 18:17:22 -0000 Received: (qmail 58617 invoked by uid 500); 25 Aug 2009 18:17:46 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 58564 invoked by uid 500); 25 Aug 2009 18:17:46 -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 58539 invoked by uid 99); 25 Aug 2009 18:17:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Aug 2009 18:17:46 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of awolff@gmail.com designates 209.85.216.180 as permitted sender) Received: from [209.85.216.180] (HELO mail-px0-f180.google.com) (209.85.216.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Aug 2009 18:17:38 +0000 Received: by pxi10 with SMTP id 10so6291375pxi.28 for ; Tue, 25 Aug 2009 11:17:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=n+Qp9rZSAlUYKtEP9tMrPveYqRo1dNjN4NOdirSj0Pc=; b=VJE46GJVLVO08NOZWOLow5/VkOmpkJ+SPr+w07gL1BxWk0Ah37i+FU/QPKfQmG+gCI MpPJQKgqN1JpeRIYZPPERXzfEMfWXMZH9qbIpDcgfdZPZEfDhPel76RG+i0zSenGggNy ue8DF0FtcorhqYRC/vnrZ+kRxZU4Ayhksqmn0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=IHqqGijF5D+sMdjqh0/X25fEbDYixRWBX8yH+Cpljek+RixhcRmq7q01xqrvojnhl5 02/5S2JqJYjtZplVoN0EdYuD2xPbT6T/vsY5kd4XczhGv7AfD+LnJYent6eEHusb3wW5 rB4PJoKAbVcqqfDqoB6YmCBbUgNsUUiJCuXik= MIME-Version: 1.0 Received: by 10.141.29.21 with SMTP id g21mr2921459rvj.113.1251224237936; Tue, 25 Aug 2009 11:17:17 -0700 (PDT) In-Reply-To: References: <4A93F34F.4030909@gmail.com> Date: Tue, 25 Aug 2009 11:17:17 -0700 Message-ID: Subject: Re: Referential Integrity with Unique IDs From: Adam Wolff To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=000e0cd3723e3c91ab0471fb58f6 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd3723e3c91ab0471fb58f6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I thought the point of uuids was that you could just make one up and assume that it's unique. A On Tue, Aug 25, 2009 at 7:39 AM, Paul Davis wrote: > The only way to make absolutely certaint that something is unique is > to include it in the document id in some fashion. > > I generally solve this with sha1's for docids and then reference those > ids from the doc. Depending on the size of your unique value, it may > be beneficial to include a copy inline. > > HTH, > Paul Davis > > On Tue, Aug 25, 2009 at 10:21 AM, Jan Vincent > Liwanag wrote: > > Hi guys, > > > > For some document type, I have some property 'x' which I'd like to be > unique > > across all records. However, the value for this property may change. > > > > The way I see it is that I have two options. If I derive the id from this > > property 'x', then I am assured of its uniqueness. However, I cannot > easily > > change the value for property 'x', as the value of the id depends on it. > > Moreover, I may have to update all records which refers to it. > > > > If I use a uuid however, referential integrity is retained. However, I'm > not > > sure if CouchDB alone can make sure that the value for that property is > > unique. > > > > Any thoughts on this? > > > > Thanks, > > > > JV Liwanag > > > --000e0cd3723e3c91ab0471fb58f6--