Re: Re: using UID in DB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 11:08 AM -0700 3/31/10, Tommy Pham wrote:
On Wed, Mar 31, 2010 at 10:23 AM, tedd <tedd.sperling@xxxxxxxxx> wrote:
 At 5:56 PM -0700 3/30/10, Tommy Pham wrote:

 On Tue, Mar 30, 2010 at 2:27 PM, Nathan Rixham <nrixham@xxxxxxxxx> wrote:

  nope never been able to find any significant advantage; and thus ended
  up using http uri's in my own domain space(s) which are always
  guaranteed to be unique as I'm issuing them. bonus is that they can be
  dereferenced and server as both a universal (resource) identifier and a
  locater.

  ps: resource = anything that can be named.


 Hi Nathan,

 I'm interested in hearing your technique of generating your own uuid
 if you don't mind sharing :).  I'm building a project to test my idea
 about search engine and testing of different RDBMSes.  So naturally,
 it (the app) would crawl the net and I'd have over a 1 billion rows.

 Thanks,
 Tommy

 PS: Here are some info for those who haven't heard of UUID/GUID:

 http://affy.blogspot.com/2003/03/why-use-uuid-values.html
 http://www.mysqlperformanceblog.com/2007/03/13/to-uuid-or-not-to-uuid/


 I've read your links and see the problem presented.

 The solution is to create an absolutely unique user ID and therein lies the
 problem. How do you create something that is absolutely unique?

 Clearly, if you have one database creating records, an auto_increment will
 work for creating an unique number for that's what increment does.  However,
 if you have more than one database creating records at the same time, then
 conflicts would occur.

 I had a similar problem recently where I used two fields to identify a
 record as being "unique". One field used the exact time the record was added
 to the database and the other field was a random number. Combining the two
 numbers I believed I had a unique number for the taks I was doing. Of
 course, if activity was spread across hundreds of servers with millions of
 entries per second, then my method would not be a solution. As such, the
 solution should be tailored to the problem.

 Cheers,

 tedd


The original implementation of UUID/GUID includes MAC of the NIC which
will guarantee that uniqueness.  But because of certain privacy issues
brought up, they have to come up with other methods, though slightly
less unique. I've not heard of someone running into collision using
UUID/GUID.

I didn't say otherwise.

At some point, you asked how others solve the unique problem and I provided my solution.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux