On 29/12/09 20:35 +0100, Hartmut Goebel wrote: > Cédric Krier schrieb: > > > The randomness is for external people as I explain on previous email. > > For this case a pre- or postfixing the date should not be a problem. So > if using real random values, one could store them, keep them for a day > or two and then clear the old values. > > Another possibility would be to shorten the value: > * date + md5(sequence + random)[:16] >
The problem is not to check the uniqueness, we will use postgresql for that with an index. The problem is the scallability of the solution, yours doesn't scale better then my first one. It will just need a lot of sequence request per day. But a timestamp is perhaps the solution with a wait if there is a collision. The sequence will have a timestamp precision field and a last timestamp used. -- Cédric Krier B2CK SPRL Rue de Rotterdam, 4 4000 Liège Belgium Tel: +32 472 54 46 59 Email: [email protected] Jabber: [email protected] Website: http://www.b2ck.com/ twitter: http://twitter.com/cedrickrier identi.ca: http://identi.ca/cedrickrier
pgpmDM4w4BIc9.pgp
Description: PGP signature
