Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 26531 invoked from network); 22 Jun 2010 19:05:57 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Jun 2010 19:05:57 -0000 Received: (qmail 82983 invoked by uid 500); 22 Jun 2010 19:05:55 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 82877 invoked by uid 500); 22 Jun 2010 19:05:55 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 82869 invoked by uid 99); 22 Jun 2010 19:05:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jun 2010 19:05:55 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=10.0 tests=AWL,FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tsaloranta@gmail.com designates 209.85.160.172 as permitted sender) Received: from [209.85.160.172] (HELO mail-gy0-f172.google.com) (209.85.160.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jun 2010 19:05:49 +0000 Received: by gyh4 with SMTP id 4so3380700gyh.31 for ; Tue, 22 Jun 2010 12:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=nYPW7DObjaJihhzj9HueZE7sP4wGOy2hbybf1zHVH7I=; b=cDsQVfH1e5vW53uFWbPPaIP/+Ch8mFkp5TaEfjSjmCxegZvrxRIHanjI9msNEwAI0K AURRLg1BD2/TnzeWxDpGaMcbz/Xz9EUKY7kxDBjpsNCwjAJ+LFP3HG0XhL1Vl1UNsIZJ ubDa2RxwSD8akyi9HrRupJwzdqY3WMfPomDmA= 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=jnaCgIw1yE5jHCcUgRehIbm+wR1aYOQjEiF21nR/TyV2gzTSI/3ixFBS8sxBvxrC8Z AJK0MDtH/AcYT1hF09Keh6QYSg7SJqk1iJ19iFneyUGHbeOMILF7JbKM0UBaBGz3FF4W +gBQ45SvrS2hOkbdLcNPsvZWcXZW+J1vhd48I= MIME-Version: 1.0 Received: by 10.90.162.20 with SMTP id k20mr4367542age.145.1277233527569; Tue, 22 Jun 2010 12:05:27 -0700 (PDT) Received: by 10.90.55.8 with HTTP; Tue, 22 Jun 2010 12:05:27 -0700 (PDT) In-Reply-To: References: Date: Tue, 22 Jun 2010 12:05:27 -0700 Message-ID: Subject: Re: UUIDs whose alphanumeric order is the same as their chronological order From: Tatu Saloranta To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 On Tue, Jun 22, 2010 at 9:12 AM, David Boxenhorn wrote: > A little bit of time fuzziness on the order of a few milliseconds is fine > with me. This is user-generated data, so it only has to be time-ordered at > the level that a user can perceive. Ok, so mostly ordered. :-) > I have no worries about my solution working - I'm sure it will work. I just > wonder if TimeUUIDType isn't superior for some reason that I don't know > about. (TimeUUIDType seems so bad in so many ways that I wonder why anyone > uses it. There must be some reason!) I think that rationally thinking random-number based UUID is the best, provided one has a good random number generator. But there is something intuitive about rather using location + time-based alternative, based on tiny chance of collision that any (pseudo) random number based system has. So it just seems intuitive safer to use time-uuids, I think -- it isn't, it just feels that way. :-) Secondary reason is probably the ordering, and desire to stay standards compliant. As to ordering, if you wanted to use time-uuids, comparators that do give time-based ordering are trivial, and no slower than lexical sorting. Java Uuid Generator (2.0) defaults to such comparator, as I agree that this makes more sense than whatever sorting you would otherwise get. It is unfortunate that clock chunks are ordered in weird way by uuid specification; there is no reason it couldn't have been made "right way" so that hex representation would sort nicely. -+ Tatu +-