Ok, I see. In fact I'd be happy to reduce it to 12 characters instead
of 36, as long as it's enough to store all my data. But since it's
enough for YouTube I guess that'd be enough for me.

1) So, should I only save the farthest right characters (i.e
'42665d440a17' in the following example)?

550e8400-e29b-41d4-a716-42665d440a17

But wouldn't there be conflict if another UUID is generated like the
following (i.e. different except for the 12 characters on the right)?

810e8ba7-f13c-5de8-821a-42665d440a17

2) Also, if I decide to save, say, 16 characters. Should I keep the 16
characters on the right after stripping off the dashes?

3) One last question. Which algorithm is best to use? 1, 2, 3, 4, 5?
According to Wikipedia [1], the #5 is most secure, but I don't know if
security would actually be an issue for referencing objects in the
database.

Thanks!

Julien

[1] http://en.wikipedia.org/wiki/Uuid

On Apr 6, 2:16 pm, Peter of the Norse <[EMAIL PROTECTED]>
wrote:
> On Mar 31, 2008, at 6:20 AM, Julien wrote:
>
> > What do you think is best practice? Also, how do you explain that
> > youtube, for example, only uses a dozen characters (and not 36 like a
> > UUID) to identify videos?
>
> UUIDs are designed to be unique within a database no matter how many
> tables or rows are used. Not only that, but they are likely to be
> unique even after two databases are merged. So if YouTube and Google
> and the US Federal Gonverment and all the rest of the databases in the
> world were using UUIDs, and they all merged into one huge Omni-
> database, there would be ~40% chance of conflict. Since that's not
> likely to happen any time soon, 12 characters are enough. And if
> YouTube and Vidder merge, they can just add a y/v to the end and
> that's good enough.
>
> --
> Peter of the Norse
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to