Hacker News new | ask | show | jobs
by kstrauser 1848 days ago
But now you’ve tried code complexity for a few bytes if storage. That’s just not worth it.
2 comments

8 extra bytes per row and per foreign key reference relative to an int64 can add up quickly especially if the row is small. I agree it’s not typically the right trade off but it’s not as absolute as you claim.
This is why we need 2TB drives now, when we used to get by with 2GB.
Back in my day we measured things in Ks, not Ms or Gs or Ts.

Get off my lawn...

But seriously, UUIDs work, they don't need application code to avoid collisions. If you want something a bit more compact/shardable, use ULIDs.