isn't there a 1 billion dollar bounty from someone if you can manage to cause a uuid collision naturally?
2026-08-13 20:17:35
8
cereal :
i would just prefix or suffix it with the server ID, if you for example have 10 servers you get the IDs (01)193 and (10)193
2026-08-14 09:52:39
8
️UE★Genaro :
even if the uuids collide just regenerate it
2026-08-13 20:52:54
33
Broseph :
The only correct way to solve this problem is a UUID or a GUID. Each unique user gets one. You should never have a collision event.
2026-08-13 19:35:19
8
PanSage_ :
servid,userid
2026-08-17 21:39:50
0
160ormore :
Just make it read the other database and make sure the id is unique, whats the problem with this one?
2026-08-13 22:02:49
0
LizardRyan :
just do like 1-1 to 1-9999 and 2-1 etc for 2 servers.
2026-08-13 22:03:32
4
Verso Dessendre :
After reading some comments:
Prefixing the user ID with the server number won't really solve the problem, because eventually you'll still run into collisions or scaling limitations. UUIDv4 would technically work, and collisions are astronomically unlikely, but not mathematically impossible. More importantly, random UUIDs are terrible for database locality and can hurt index and insert performance at scale.
A much better solution would be something like Snowflake IDs: globally unique, time-sortable, compact, fast to generate, and specifically designed for distributed systems without requiring every server to coordinate for each new ID.
2026-08-15 01:07:24
1
jeepman220 :
why just ot use a server id as prefix to the id?
2026-08-13 18:34:16
25
' :
what's wrong with offsetting the increment by the server count?
2026-08-13 21:37:58
0
MemeFox_ :
So you'd have it do a mathematical equation that never generates the same number, that can be scaled easily.
2026-08-13 21:23:48
0
Kiuseii :
keep the last 3/4 number of the id as "server is" all other increment like normal.
So your first id on server 1 will be 1001 and for server 2 1002. You dodge the compute time of the UUID, you have no risk of colision with 999 servers (Even if i think the "colision risk" of UUID is not a probleme at all)
2026-08-13 23:55:59
1
Система оповещения :
Or you can prefix the user ID with the server ID. This is already used in production, I know a game that does it.
2026-08-13 20:06:24
31
Sharpie :
Use the Facebook thing with server id timestamp and random value
2026-08-13 17:59:08
6
SquareTurtle :
Have a server id. For the first byte then an incrementing.
2026-08-14 15:02:30
6
sophia 🇪🇺 :
how about auto increment after a server identifier of some sort. for exaple server A will auto increment with A1,A2,A3.... and server B with B1,B2.... when u get to Z, u do AA. then AAA etc...
2026-08-13 22:06:55
8
Aderka :
Check the last ID created and increment
2026-08-14 00:51:55
2
nimsara mahabaduge :
what if we generate an id based on user data? like email?
2026-08-14 04:24:10
0
🤦♀️ :
What if there is a need to have a unique id? Can’t we just use id sequencer from db?
2026-08-13 23:49:49
0
VibingGhost :
UUID7 solves this. Contains a timestamp and guaranteed random string.
2026-08-14 14:56:41
0
harvėy :
or just make every uid begin with the server number. server 1 distributes uids with 1, server 2 2 etc
2026-08-14 22:22:21
1
Phill :
im not a dev but i would use a uuid tgen check the database if it exist
2026-08-13 17:20:54
4
Paul Brinker :
one server is fine, your never going to have so many new accounts that the ID server bottlenecks
2026-08-13 20:11:24
2
To see more videos from user @arjay_mccandless, please go to the Tikwm
homepage.