Hacker News new | ask | show | jobs
by hackinthebochs 1791 days ago
Using incrementing ids as your source of ownership is just asking for trouble. This just means a programming error can have a high probability of ids lining up and leaking resources. Guids make this practically impossible.
2 comments

I wonder if there's any widely implemented programming pattern that would catch this better, eg consisting of concatenated type code and id. Using GUIDs here would still hide the bug, not flag an error.
I don’t know if it’s widely implemented, but the way Stripe IDs resources comes to mind.
Interesting, I hadn't thought of that advantage of uuids/guids before.