Welcome Guest, Not a member yet? Register   Sign In
Why I use UUIDs for primary/foreign keys
#7

[eluser]slowgary[/eluser]
I use integers as well, but have looked at UUIDs. Mainly the reason that I hadn't switched was that I feel comfortable with using integers already, but I hadn't really looked at pros and cons so this thread helps.

I can add to the argument of uniqueness though. UUIDs are unlikely duplicated, but that doesn't mean it's not possible. If you handle the possibility of duplication then you're okay. BUT, you can't really argue that they're more unique or less likely to collide as integer IDs, because integer IDs are auto-incremented, so there will NEVER be a collision, and you don't need to write the code to handle one.

I do see where UUIDs would make combining tables easier, but I've never had need to combine tables and if I did I'd probably just have to write a script to handle the IDs.

I think for simplicity I will stick with integers but if I had a need for a bit of extra security/obscurity of data in an app I will consider UUIDs.


Messages In This Thread
Why I use UUIDs for primary/foreign keys - by El Forum - 06-06-2009, 03:56 PM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-06-2009, 04:10 PM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-06-2009, 04:28 PM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-06-2009, 05:01 PM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-06-2009, 07:02 PM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-06-2009, 07:44 PM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-07-2009, 07:06 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-07-2009, 07:11 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-07-2009, 07:32 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-07-2009, 09:11 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-07-2009, 09:59 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-07-2009, 10:34 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-07-2009, 10:49 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 12:47 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 01:47 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 02:03 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 02:24 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 07:41 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 07:45 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 07:52 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:08 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:12 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:15 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:21 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:24 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:26 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:28 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:30 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:33 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:35 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:39 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:39 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:46 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:52 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:53 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 08:59 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 09:01 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 09:04 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 09:12 AM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 06:08 PM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 09:44 PM
Why I use UUIDs for primary/foreign keys - by El Forum - 06-08-2009, 09:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB