5 ms·
Extracting timestamp and MAC address from UUIDs
- pbbakkum 12y agoWe encountered some of these same issues and wrote this library to mitigate them: https://github.com/groupon/locality-uuid.java https://github.com/groupon/locality-uuid.java. I think UUIDs make good unique ids overall, particularly in distributed environments where id generation can't be coordinated, but should be used carefully, as the article notes.
- X-Istence 12y agoWhy not just use UUID 4: http://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29 http://en.wikipedia.org/wiki/Universally_unique_identifier#V... This will have an better distribution for when they are used as keys as well.
- e12e 12y agoAs far as I can tell, neither MySQL, nor MariaDB has a function for generating type 4 UUIDs. It's of course possible to generate the UUIDs on the client side, but then it's not really an alternative to auto-incrementing surrogate keys.
- geofft 12y agoThere's a story that the creator of 1999's "Melissa" virus was found via a GUID in the Word document that included their MAC address. (I'm having trouble confirming the veracity of this, since the web is full of citogenesis that links to http://www.zdnet.com/news/tracking-melissas-alter-egos/101974 http://www.zdnet.com/news/tracking-melissas-alter-egos/10197... which isn't super clear, but it's a good story nonetheless.)
- elmin 12y agoAn alternative that was posted here a week or so ago: https://eager.io/blog/how-long-does-an-id-need-to-be/ https://eager.io/blog/how-long-does-an-id-need-to-be/
- klodolph 12y agoOr you could just use type 4 UUIDs. We know 64 bits is likely too small, and 128 bits is likely enough. Why bother saving a few bits here and there, if you already have a working solution?
- zackbloom 12y agoThe example in the post is because full UUIDs are uncomfortably long for URLs, and have more entropy than is necessary for the application in question.
- girvo 12y agoFor unique IDs in databases, you want them to have common prefixes such that they are kept in rough time order in the database's backend, otherwise your indexes can end up huge and degrade performance (especially in MySQL, that's where we got bitten by it). That's where Type 1s are great, but of course this article shows a major downside.
- _lce0 12y agoWhy tapping on any text will navigate to another page? I've seen the same before, on blogs using the same theme. Is that to increase hits? It's really annoying for the reader experience!