3 ms·
I've tried a few different key strategies. A UUID per row per table seems to work best. Where I define "best" as "suiting my data better". I get the thing abou
by marcus_holmes 8y ago
I've tried a few different key strategies. A UUID per row per table seems to work best. Where I define "best" as "suiting my data better".
I get the thing about deriving keys from data, but it always seems messy to me. I've seen too many weirdnesses in "real" data to be comfortable that there will not be any collisions (I used to play around with a database of every person and their address in the UK. There were several cases of people having the same name, the same birthdate, the same street name, but different towns. Not to mention the hundreds of cases of twins with only an middle initial to tell them apart.)
UUID's might be clunky and a little slower, but at least I will never get a collision, and never cause a problem if I use one key instead of another. I'm totally happy to spend more time optimising my database in exchange for those guarantees.
- tempguy9999 8y ago> Where I define "best" as "suiting my data better". Can't argue! You're in the best place to decide. > UUID's [...] but at least I will never get a collision Hmm, please do some googling for that. I've heard complaints (on the web, not in person) of this happening surprisingly easily. This may not apply for you though. Personally I only trust what I understand, or what I have written guarantees for. Anyway FYI.