3 ms·
You use a GUID or counter as a user ID, and add a username field which resolves to this ID? You would then have to enforce username uniqueness when assigning/r
by cryptarch 10y ago
You use a GUID or counter as a user ID, and add a username field which resolves to this ID?
You would then have to enforce username uniqueness when assigning/renaming usernames.
- onion2k 10y agoCounters are a bad idea if they're ever used in a user-facing context. They're trivially enumerable so an outside party can write a script that iterates over them, which is usually a bad thing. That's easy to block, but it's better to design the system in a way that makes it impossible in the first place. Plus, user-facing counters can leak business information - if I sign up and see example.com/user/1234 as my user page and then I create another account a week later and get example.com/user/1235 then I know the platform isn't growing very quickly. tl;dr Don't use counters for anything that that'll end up on the frontend.