tags:

views:

28

answers:

0

Hello:

I am working on the design of a database which will potentially hold millions of records. Each record will have only a few pieces of data (say, about fifteen fifty-character strings).

The different records belong to the same class of object, but from a different "source"; a namespace would capture this relationship. For instance, object 1 belongs to namespace 1, object 12321 to namespace 2, etc.

I want to design the unique identifiers for these records.

If I were to use UUID version 5, generating the UUID attached to the namespace would be trivial. However, there is no way of knowing wether a given UUID belongs or not to a given namespace.

Then I thought of an algorithm along the lines of Luhn's Algorithm (the one used for credit card numbers) which checks wether a number is "correct" or "not".

How would you go about this?

Requirements:

  1. All the UUID requirements
  2. Ability to check that a UUID belongs to a given namespace