3 ms·
> Where do you have unique ids that aren’t the primary key? For things that need public IDs, I always generate and store uuid4s* to avoid leaking database stat
by hot_gril 3y ago
> Where do you have unique ids that aren’t the primary key?
For things that need public IDs, I always generate and store uuid4s* to avoid leaking database state or anything like that. Even uuid7 leaks creation timestamps. It's cheap and easy to map public IDs to/from PKs at the API boundaries.
* possibly encoded as something nicer like base64 for APIs or URLs