Re: Re: using UID in DB
| From: | tedd | Date: | Wed, 31 Mar 2010 18:16:02 +0000 |
| Subject: | Re: Re: using UID in DB | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-303704@lists.php.net to get a copy of this message | ||
At 11:08 AM -0700 3/31/10, Tommy Pham wrote:
On Wed, Mar 31, 2010 at 10:23 AM, tedd <tedd.sperling@gmail.com> wrote: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.comAt 5:56 PM -0700 3/30/10, Tommy Pham wrote: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.On Tue, Mar 30, 2010 at 2:27 PM, Nathan Rixham <nrixham@gmail.com> wrote: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, teddnope 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/