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 2001DD697 for ; Fri, 9 Nov 2012 01:31:59 +0000 (UTC) Received: (qmail 83613 invoked by uid 500); 9 Nov 2012 01:31:57 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 83586 invoked by uid 500); 9 Nov 2012 01:31:57 -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 83578 invoked by uid 99); 9 Nov 2012 01:31:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Nov 2012 01:31:57 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of andrey.kouprianov@gmail.com designates 209.85.217.180 as permitted sender) Received: from [209.85.217.180] (HELO mail-lb0-f180.google.com) (209.85.217.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Nov 2012 01:31:53 +0000 Received: by mail-lb0-f180.google.com with SMTP id ge1so2534743lbb.11 for ; Thu, 08 Nov 2012 17:31:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=xs9D9g+stsD2FF+weN9Ff2dlzRAhKf2AV/HlXnKF0Vo=; b=HXktXz8oXfKDIgjvJqtkDiR4UakLDSFNycQ8IDAtNy/FG0dNuXG4NSt+gHPDMRi0be cz7KVWhbR1ZH6id/xxUY+FUW6Vz2W5v5uwK0nd/BBK7ybU8b1BJO5n95zJ1pu2Ct7DkN 09pFN/HTwPSHaudaNImw5Xs6orL3RzTHJnuP3S5w/W9zvHMRznsoOMgxaxXybXeAOgZW kotYiCisO4segmxIwI9M4XCEpEscemmRGAYPBmAScoPuYB4mYiV23FQZQHJ10ruZP4m0 /tBha8Bwzr7/wSbzWB/YYF2TWNU6y3fMIcUrRG5N3b6rmLD9hpCXPFZ3i1UarDogN9WH 2jzQ== Received: by 10.112.39.105 with SMTP id o9mr456241lbk.123.1352424691038; Thu, 08 Nov 2012 17:31:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.83.230 with HTTP; Thu, 8 Nov 2012 17:31:10 -0800 (PST) In-Reply-To: <20121108211246.275eecaf@svilendobrev.com> References: <20121108123234.5b64c597@eee-az> <20121108211246.275eecaf@svilendobrev.com> From: Andrey Kuprianov Date: Fri, 9 Nov 2012 09:31:10 +0800 Message-ID: Subject: Re: are auto-generated uuids unique across server-instance To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=e0cb4efe2d7e4b793704ce05e9a9 X-Virus-Checked: Checked by ClamAV on apache.org --e0cb4efe2d7e4b793704ce05e9a9 Content-Type: text/plain; charset=ISO-8859-1 Add a postfix to uuid. Just as an idea: uuid+[timetamp in ms]+[server identifier] So you will get something like cc606fe70aa52bd60da6c94835cda3ef-1349789839150-A for a document id. Then if you output all ids into a view with: function(doc) { emit(doc._id, null); } you will get your docs chronologically ordered as you will also know which server they came from. On Fri, Nov 9, 2012 at 3:12 AM, svilen wrote: > i'm asking this because i do have a machine that is 4minutes ahead > of others.. and thus a few things relying on (sorted-by) local > clock() timestamp went plop. And everyone-with-own-idea-of-time is > going to be the norm.. > > so now i'm looking for some kind of autoincrementing suffix, additional > to server-side clock being stamped on documents.. coz incoming order > does matter (multiple in same microsecond). Looked at _local_seq for > that (by copy into another field to unlocal it), but not sure if it > is always increasing (or sufficienty "always"). probably is. > > anyway, thanks > svil > > On Thu, 8 Nov 2012 10:36:13 -0800 > Mark Hahn wrote: > > > I use utc_random. It is really useful. Easy to sort by creation > > date. And you can even extract the creation date from the _id and > > save a field. > > > > On Thu, Nov 8, 2012 at 10:21 AM, Robert Newson > > wrote: > > > > > Hi, > > > > > > Here's the pertinent information on the various UUID algorithms > > > CouchDB supports; > > > > > > [uuids] > > > ; Known algorithms: > > > ; random - 128 bits of random awesome > > > ; All awesome, all the time. > > > ; sequential - monotonically increasing ids with random increments > > > ; First 26 hex characters are random. Last 6 increment in > > > ; random amounts until an overflow occurs. On overflow, the > > > ; random prefix is regenerated and the process starts over. > > > ; utc_random - Time since Jan 1, 1970 UTC with microseconds > > > ; First 14 characters are the time in hex. Last 18 are random. > > > ; utc_id - Time since Jan 1, 1970 UTC with microseconds, plus > > > utc_id_suffix string > > > ; First 14 characters are the time in hex. uuids/utc_id_suffix > > > string value is appended to these. > > > > > > The default is "sequential". > > > > > > B. > > > > > > > > > On 8 November 2012 18:13, Mark Hahn wrote: > > > > > > > http://en.wikipedia.org/wiki/Universally_unique_identifier > > > > > > > > On Thu, Nov 8, 2012 at 2:31 AM, Andrey Kuprianov < > > > > andrey.kouprianov@gmail.com> wrote: > > > > > > > > > It's a uuid. It's unique wherever > > > > > > > > > > > > > > > On Thu, Nov 8, 2012 at 6:32 PM, svilen > > > > > wrote: > > > > > > > > > > > hi > > > > > > are auto-generated uuids (when doc is saved without assigned > > > > > > id) unique across server-instance, or only within the > > > > > > database? > > > > > > > > > > > > i.e. can i take a doc from one database and write > > > > > > it as-is-without-the-_rev into another database? > > > > > > can that become a problem? > > > > > > > > > > > > ciao > > > > > > svil > > > > > > > > > > > > www.notionery.com > > > > > > www.svilendobrev.com > > > > > > > > > > > > > > > > > > > --e0cb4efe2d7e4b793704ce05e9a9--