News for hackers. Stuff that matters.
Re:Primary keys using UUID v7 are potentially an HR violation by onnnon on Monday October 06, 2025 @03:35PM (#45495342)
Don't expose primary keys to the public. Create separate external ids instead. I personally use BIGINT primary keys, with UUIDv4 external ids, but any random string will do.
Re:Primary keys using UUID v7 are potentially an HR violation by sigwinch on Monday October 06, 2025 @04:15PM (#45495809)
Plus, it’s easy to tell v4 from v7, if internally you have no choice on keys.
Re:Primary keys using UUID v7 are potentially an HR violation by 0cf8612b2e1e on Monday October 06, 2025 @03:44PM (#45495440)
Certainly seems the easiest solution. A lot of handwringing about poor database performance of UUID4 when you could use it exclusively for an external identifier all for the cost of an additional column.
Re:Primary keys using UUID v7 are potentially an HR violation by WorldMaker on Monday October 06, 2025 @03:54PM (#45495531)
Also, poor performance of UUIDv4 primary keys is most related to how write heavy your table is in the first place, and in particular how insertion heavy it is. In theory your users table shouldn't be very write-heavy, even if it may be insertion-heavy compared to other writes.