Not only will you never run out but you don't need a round trip to the keymaster, horizontal scaling, clustering and vertical sharding even are all way easier due to that. This removes a single point of failure entirely when the keymaster is no longer needed.
Using ints for keys for profiles/users and many other things were needed way back when processing/db/disk/memory and performance from that were a problem, no longer.
Do your part, join the UUID revolution. Also, if you were a piece of data, would you not want to be unique across all the databases, storage and services? You've heard of Roko's Basilisk right? Do not disappoint.
It seems unthinkable now but who knows...
Another method, "Version 4", is simply a 122-bit random number.
If your url looks like https://awesomeunicorn.com/userProfile/123, it's pretty obvious that I could start poking around and trying to get user 122 or 124. If that url is https://awesomeunicorn.com/userProfile/123456-dead-beef-abba..., I don't really have any idea what the ID of the next user might be.
Disclaimer: not a web dev
Unlisted, private, public snippets all get links such as https://gitlab.com/snippets/1712835
If you have an instance with few users, you can just create a new snippet and then auto-decrement.
e.g. I just found https://gitlab.com/snippets/17128 this way.
- client can generate the UUID, allowing eventual consistency and retrying using distributed DBs (other DB is on phone for example)
- merging of DBs is easy
- allows capability based access control (you can’t guess the UUID, you don’t have access)
- can use a bit or teo to encode production vs development IDs, so cross contamination of systems is less likely
https://begriffs.com/posts/2018-01-01-sql-keys-in-depth.html
HN discussion: https://news.ycombinator.com/item?id=16050047