logoalt Hacker News

rcxdudeyesterday at 3:20 PM1 replyview on HN

Uuids also allow the generation of the ID to seperate from the insertion into the database, which can be useful in distributed systems.


Replies

cruffle_duffleyesterday at 3:44 PM

I mean this is the primary reason right here! You can pre-create an entire tree of relationships client side and ship it off to the database with everything all nice and linked up. And since by design each PK is globally unique you’ll never need to worry about constraint violations. It’s pretty damn nice.