logoalt Hacker News

edding4500last Monday at 11:19 AM2 repliesview on HN

*edit: sorry, misread that. My answer is not valid to your question.

original answer: because if you dont come up with these ints randomly they are sequential which can cause many unwanted situations where people can guess valid IDs and deduce things from that data. See https://en.wikipedia.org/wiki/German_tank_problem


Replies

javawizardlast Monday at 11:21 AM

Hence the presumed implication behind the public_id field in GP's comment: anywhere identifiers are exposed, you use the public_id field, thereby preventing ID guessing while still retaining the benefits of ordered IDs where internal lookups are concerned.

Edit: just saw your edit, sounds like we're on the same page!

javaunsafe2019last Monday at 11:22 AM

So We make things hard in the backend because of leaky abstractions? Doesn't make sense imo.

show 1 reply