Remix.run Logo
▲ mahboi 3 hours ago

Don't expose your PKs

▲tyre 3 hours ago | parent [-]

So you have a second, opaque unique identifier for the frontend to fetch? At that point why not just use a single column (UUID)?

▲ndriscoll 3 hours ago | parent | next [-]

Higher density for indexes you use for joins. Also you can then use UUIDv4 to hide creation times if that's sensitive too.

▲ 2 hours ago | parent [-]
[deleted]
▲crazygringo an hour ago | parent | prev [-]

Yes, this is standard. And the point is performance. The needs of user-facing ID's (short alphanumeric, randomly ordered) tend to be pretty orthogonal to the needs of internal ID's (raw bits, monotonically increasing, maybe timestamp data).