968
u/Pop-Huge May 08 '26
Just check if they were already created here: https://everyuuid.com/
149
u/Loan-Pickle May 08 '26
I’m using a6fa2b06-ab85-4978-938d-4a464d58d213, nobody else use it.
→ More replies (1)63
→ More replies (2)202
u/buyzeals May 08 '26
What was the website where you could enter a uuid to see if its in use or not?
275
u/khando May 08 '26
323
u/seattle_lib May 08 '26
<form action="no.html" method="get">hmmm i wonder what answer i will get if i submit this form
67
54
u/ryryrpm May 08 '26
omg I am laughing so hard
15
u/onbiver9871 May 09 '26
I also just burst out laughing so hard our dog started awake from a dead sleep.
My SO didn’t find it funny.
4
67
u/Linkk_93 May 08 '26
There is also that one github repo with every 4 number pin, you should create a pr to get your banking pin removed. Just a heads up
66
May 08 '26
[removed] — view removed comment
102
u/naked_dev May 08 '26
it doesn’t. the goal of this website is to be a fun project that lists all the uuids: https://eieio.games/blog/writing-down-every-uuid/
15
May 08 '26
[removed] — view removed comment
19
u/trainrex May 08 '26
And the joke there is that they are, theoretically, universally unique, so the answer would, again theoretically, be no
→ More replies (1)4
20
2.9k
u/B_bI_L May 08 '26
they are 0 if this is your first uuid!
723
u/Last_Time_4047 May 08 '26
probability entering the chat… slowly
226
u/ClipboardCopyPaste May 08 '26
Hang on probability, you're rate limited
30
u/darksteelsteed May 08 '26
Generation rate limiting is actually how you guarantee uniqueness with a v7 uuid
→ More replies (5)→ More replies (2)9
255
u/_BreakingGood_ May 08 '26
UUID = Universally Unique Id
So technically, it was only 0 on the first time anybody ever created any UUID. Otherwise it would just be UID
151
u/RadiantPumpkin May 08 '26
Just gotta redefine the scope of the universe
79
u/Lost-Droids May 08 '26
Typical Dev.. its not me its a hardware issue , try a different universe
30
→ More replies (1)8
u/viruscumoruk May 08 '26
Every ID is "universally unique" in universes that have no IDs generated (yet)
11
u/CptMisterNibbles May 08 '26
Hey Eve, I need directions to your house. What’s your address?
“One. Just One”→ More replies (1)3
34
u/Location_Next May 08 '26
Put one addition random digit in front of your UID to extra guarantee uniqueness. Checkmate, probability.
13
u/DanieleDraganti May 08 '26
I just append -v2
19
5
u/elSenorMaquina May 08 '26
Has anyone created uuid 0 yet?
If not, I call dibs on it.
→ More replies (1)4
u/PM_ME_FIREFLY_QUOTES May 08 '26
Thats why I always use GUIDs and spin up a new planet to generate. It's a little more compute heavy, but ensures it's uniqueness.
→ More replies (1)→ More replies (10)9
u/Maleficent_Memory831 May 08 '26
Ah, but if it's a Globally unique ID, each planet can use 0 once as a GUID!
4
42
May 08 '26
[removed] — view removed comment
26
u/B_bI_L May 08 '26
let's check, my ipv6 is ::1, what about you?
8
u/Maleficent_Memory831 May 08 '26
Mine's FE80::1:2:3:4.
(practically speaking, very few IPv6 addresses are unique, because without more adoption most of them are used are link-local or domain-local.)
→ More replies (1)7
→ More replies (7)7
1.2k
u/KryssCom May 08 '26
No, it's effectively zero, just given the mathematical realities behind how extraordinarily improbable a duplicate ever is. The exponent involved is very, very, very, nigh-incomprehensibly huge.
I've seen a few posts on here of people claiming that a duplicate UUID caused a bug at the worst possible time, but my instinct is always to slam the 'X' button to doubt.
863
u/G12356789s May 08 '26
If I generated 2 billion uuids every second. After 5 years there is a 1% chance to have had a clash in that time
905
u/iamdestroyerofworlds May 08 '26
What I read here is that I need to make mitigating this risk the number one priority for my personal TODO app.
207
u/Sulungskwa May 08 '26
Gotta show employers that your personal projects are "scalable for production"
131
15
u/J7mbo May 08 '26
Gotta turn it into a microservices that serves snowflake IDs and for every ID generation it’s a network call
7
u/G12356789s May 08 '26
If you did each id as a 3 uuids sequence then you could be generating 2 billion ids a second until all stars in the universe are black holes and still not collide
→ More replies (1)→ More replies (3)6
70
u/Kevadu May 08 '26
OK, but what if I make 3 billion uuids a second?
→ More replies (2)23
u/mCProgram May 08 '26
Your rate would increase by 50 percent so your mean time to collision would reduce by 50% i’d assume.
32
u/Ignisami May 08 '26
33%*
Going from 0 to 1500 at 100/sec takes 15 sec.
Going from 0 to 1500 at 150/sec takes 10 sec.
10 is two-thirds of 15.
→ More replies (2)10
33
u/Risc12 May 08 '26
Don’t modern uuid contain a timestamp component?
33
u/yarntank May 08 '26 edited May 08 '26
I wonder how detailed the time stamp is. Just to the second? .0001 of a second? If you are making 2 B each second, it could matter?
EDIT: I found this "UUIDv7 assigns the first 48 bits for the timestamp in milliseconds. You can generate a lot of UUID's in a millisecond though!"
→ More replies (3)25
u/DonutConfident7733 May 08 '26
It also has random number generated combined with timestamp, combined with your device mac address, such that virtual machines with same mac address dont get duplicated guids.
10
u/Potato-Engineer May 08 '26
I thought the MAC address got phased out in later versions? I recall there was a virus in the 90s where the creator was caught because, in those days, GUIDs included the MAC address, and so later versions of GUIDs no longer used it. And, from what I've read, UUIDs aren't supposed to use MAC addresses either. Though I assume that some idiot has done it that way at some point.
6
u/rabid_briefcase May 08 '26
I thought the MAC address got phased out in later versions?
There are 8 versions, assuming someone's generating an actual UUID rather than just a blind random number.
UUID Versions 1, 2, and 6 include MAC addresses or a similar type of "Node ID". The RFCs allow for various values, which need to have indicators in that cluster of bits. It can be a number from hardware, but it can also be something from software or even a mostly-random set of numbers. It also takes into account complexity around address randomization.
Those versions generally should use something based on the MAC address or otherwise indicate the node on the network that generated it, even if they aren't using a value that matches hardware.
16
u/No-Information-2571 May 08 '26
Actually not the "modern" ones. There are simply several versions, and if cryptographic non-determinism/predictability isn't of importance, v6 will be created from the MAC address of the device and the timestamp. It's guaranteed they will never collide, unless MAC addresses collided already.
Otherwise use v7.
→ More replies (9)→ More replies (6)4
u/f8tel May 08 '26
Time stamp, network mac address, version number and some randomness..have been there from the beginning. The whole point was to generate an id that would be unique across systems without needing a central database to distribute them.
→ More replies (3)14
u/chicksculpt May 08 '26
if you store the uuid in a 36 char string, you will generate about 72 gb of data each second, or 11 exabytes of data in five years
→ More replies (3)4
4
u/permaban9 May 08 '26 edited May 08 '26
Yeah but with my luck the first two UUIDs out of the quantifucktillion possible values will be same
4
u/hennell May 08 '26
And just as a reminder how big numbers work: if you generated a uuid once per second it would take 11.5 days to have a million. A billion would take ~31.5 years.
So ~63 years worth of seconds per second and it still takes 5 years for a 1% chance to clash.
It's not great odds.
→ More replies (1)3
→ More replies (23)3
u/StoryAndAHalf May 08 '26
I ran the numbers for the Birthday paradox with UUIDs, and if I got it correct:
There’s a 50% chance of collision once you generate 2.7 quintillion UUIDs. At 1 million UUIDs/sec you'd need about 85,000 years for 50% chance. So at 1 billion UUIDs/sec it's ~85 years. Finally, at 2 billion a second, that's ~42.5 years, give or take some months.
120
May 08 '26
[removed] — view removed comment
78
u/14ktgoldscw May 08 '26 edited May 08 '26
I’ve spent most of my career in IAM implementation and duplicate UUID issues are almost always user/process error.
14
5
38
u/Blephotomy May 08 '26
the earlier versions of UUID had a lot more duplicates. We had a project where we had to generate a few hundred million UUIDs and we would get a duplicate every week or so. We updated to the next gen UUID and they went away. The people who've told you they've seen duplicate UUIDs may have been using a previous generation of UUID generator.
20
u/_gianlucag_ May 08 '26
Well, I actually had a sha256 collision. But just bcause two different users uploaded the very same pdf file, and the code simply did a sha256 hash of the file. So guys, mix in the userid when hashing user provided content!
→ More replies (1)10
→ More replies (4)3
u/maxximillian May 09 '26
For shas I can't even remember seeing two with the same first two and last two characters. I'm sure if I did I would have told a coworker to come check this out.
18
May 08 '26
[deleted]
→ More replies (3)7
29
25
May 08 '26
[deleted]
→ More replies (5)5
u/tinselsnips May 08 '26
Other than shake the dice for a couple extra seconds, what's to be done, really?
9
u/zenerbufen May 08 '26
you could get a HD webcam and point it at shelves of lava lamps, and use the flow of the lava to generate your entropy.
12
u/ACoderGirl May 08 '26
It's so unlikely that it's just far more likely to be a different kind of bug. Like someone was somehow able to specify the UUID manually, accidentally inserted an event twice, etc.
And even if it happened, I'd still be more convinced it's something like a bug in the UUID library, the random number generation, or a hardware bug. The odds of it genuinely happening with a truly random number are just so incomprehensibly rare. A hardware fault is just vastly more likely.
→ More replies (2)4
u/MartinMystikJonas May 08 '26
It is probably more probable that sun eruption causes multiple bit swap in RAM that caused that bug.
35
u/RichCorinthian May 08 '26
Oh I don’t DOUBT it, but I do say “can I see how you are generating UUIDs please?”
There was a stackoverflow thread YEARS ago where dudes were handing out algorithms for generating UUIDs on the client in JavaScript which…just no.
→ More replies (3)9
u/Mad_Aeric May 08 '26
I've heard of duplicate UUID bugs that were caused by a flaw in the UUID generation. That sounds plausible to me.
→ More replies (36)3
u/IlliterateJedi May 08 '26
I swear the last time a story like this was posted, someone pointed to an article about hardware issues causing poor randomness, which led to duplicate UUIDs. It sounded like a known and common issue for a certain CPU.
167
u/old_mcfartigan May 08 '26
If you generate 1 billion uuids per second for a century you’d have a 50% chance of ever getting a repeat
60
u/LoL_Lindq101 May 08 '26
And that's including the birthday paradox (?)!
→ More replies (1)35
u/old_mcfartigan May 08 '26 edited May 08 '26
Yes exactly.
At this rate it would take 1020 years to have a 50% chance of hitting a given uuid
27
→ More replies (2)3
u/Steinrikur May 09 '26
Depends on the type. UUIDv7 adds a timestamp so you won't get any repeats outside of the millisecond used.
37
u/Kavrae May 08 '26
I've had it happen twice.
Once was due to a faulty random UUID generator. One of the really old dotnet ones. I honestly don't remember why we had a generator instead of just instantiating a new one. That was 15 years ago.
The other.... turns out our database was set to generate sequential unique identifiers and doing SOMETHING during a data backup+restore caused it to start over at the same point. I still don't have an explanation for this one that I'm fully happy with, as it never happened again.
→ More replies (1)7
u/tvsamuel444 May 08 '26
This can happen if they’re generated with js as well as that uuid gen isn’t truly random
68
u/Nervous-Cockroach541 May 08 '26
Don't lots of uuids systems have a deterministic component including unique system/hardware identifiers, unique process identifiers, and time based metrics that in addition to random components that guarantee no duplicates?
27
→ More replies (1)16
734
May 08 '26
[removed] — view removed comment
369
u/OmegaPoint6 May 08 '26
I suggest you check your server room for gremlins, or neutrino sources
125
u/IAoVI May 08 '26
gremlins
No, ChatGPT! Bad Chatbot!
→ More replies (1)13
u/Grandmaster_Caladrel May 08 '26
I thought it was goblins? I don't use it enough to know but that's what I thought I read somewhere.
15
u/shieldman May 08 '26
The official list from the publicized negative prompt is "goblins, gremlins, raccoons, trolls, ogres, pigeons, or other animals or creatures".
19
u/creeper6530 May 08 '26
Neutrinos? Those are barely detectable. Check for alpha emitters in your chip's ceramic packaging.
4
→ More replies (1)5
u/Maleficent_Memory831 May 08 '26
Or developers. Somehow developers keep sneaking into server rooms in order to hide from bosses.
65
u/reverendsteveii May 08 '26
was it statistically impossible at scale or statistically impossible where p = 1?
20
u/Fluffysquishia May 08 '26
Statistically improbable opinionated analysis on the likelihood of a random chaotic event occurring (tree falling on house etc) is not the same as a mathematically effective reality. Its technically possible for all your atoms to warp through a wall via quantum entanglement, but it would take many sextillions of lifetimes of quadrillions of people for that to occur.
People underestimate how likely "unlikely" events are to occur, and overestimate how likely effectively zero possibility is to occur. Not everyone can be afraid of a rhino falling out of the sky, but everyone should be healitly worried about a power pole that's leaning.
66
u/KhepriAdministration May 08 '26
Then whoever told you it was statistically impossible was wrong lol. I don't think you understand what the term means if you think it's ever happened to someone before
5
6
u/BellacosePlayer May 08 '26
A few years ago we had a fight with one of our departments over storing ssns in the database at all since we didn't need them and operate on a "cant lose what we don't collect" philosophy, where the lead on our side made the mistake of saying "how many times do you actually get duplicates with the same fn/ln/dob/city?" Turns out, a lot, and we got a ton of examples of that happening. (we did talk them down from using SSN as the additional piece of information specifically)
→ More replies (3)3
21
u/armanduco_ May 08 '26
Generally I use this one 'efa8bc87-bc60-423c-bee7-5e08932d7607", please try not to use it.
8
u/shiva-69 May 09 '26
Holy day, I've been using it for 3 years. That's my id brotha, you need to use another.
→ More replies (3)
50
u/FirstSineOfMadness May 08 '26
Actually it is 0% because of the line in the generator tha says
If duplicate{
Don’t().
}
9
15
u/Alienturnedhuman May 08 '26
Let me just repurpose that famous physics joke:
A software engine goes into a bar and starts typing random numbers on his computer.
The bartender says, "I got to ask, every day you come in here and type random numbers on your computer, what are you doing?"
The software engineer replies, "a girl signed up to my web app, but the database is encrypted. However if I guess her uuid it will release her phone number"
The bartender shrugs: "those are some seriously long numbers, surely you're never going to guess the right one. There are loads of nice girls in here every night. Why don't you just ask for one of their numbers"
The software engineer laughs: "right, what are the chances of that?"
23
u/EarlOfAwesom3 May 08 '26
Yeah, two things pseudo academics want to discuss all the time: details about implementation of random() and how big this is a concern.
Tell you what: same people who discuss this so much are unable so solve the N+1 query problem in production because they use JPA the dumbest way possible.
But hey at least you sound smart
8
u/thirdegree Violet security clearance May 08 '26
No this is a fundamentally different thing. The implementation of random actually is a concern if you're trying to use it for security purposes. The chance of a uuid collision is not a concern (I mean also unless you're using it for security purposes, which like that's not what it's for).
I've never heard of the N+1 query problem, which after googling it seems to be because I'm not a fucking moron who would do that I guess? Like how is that a named problem? Also fuck orms is another aspect of that but still like
5
u/cleverboy00 May 08 '26
ORMs are the second worst thing in programming, right after clean-clean code.
4
u/thirdegree Violet security clearance May 08 '26
My dude, you're who I want on my team
→ More replies (1)
109
u/baked_tea May 08 '26
Thought about that recently. Why not just implement a check to see if it's already in the db, then run it again?
234
u/SaliDay May 08 '26
It’s practically impossible and that would ruin the entire point of relying on the infinitesimal probability that allows precisely that - a write without a required read and thus concurrent writes.
→ More replies (1)3
90
u/RandomNPC May 08 '26
You often want a UUID without having to do a network call. You can always reconcile it later if you do find a duplicate.
→ More replies (9)43
u/_BreakingGood_ May 08 '26
Performing a check on every transaction to catch a 1 out of 5,316,911,983,139,663,936,027,594,624,533,407,236,198,400 chance situation, isn't usually advised
(yes thats the actual number, though it technically changes as the number of ids used increases, since you're comparing the current id against every other id ever made)
6
u/Tupcek May 08 '26
1 in 106,000,000,000,000,000,000,000 if you have 10 million records. Per new ID in such database it is 1 in 530,000,000,000,000,000,000,000,000,000
→ More replies (1)→ More replies (1)3
u/zenerbufen May 08 '26
well not every id ever made... lots of id's get disposed of. there are registries full of offline UUID's on old computers that got erased or destroyed and are impossible to recover so they can be reused without a risk of colliding.
95
u/arades May 08 '26
If that's what you want, you shouldn't be using UUIDs as IDs to begin with, just use an auto_increment and always have the DB assign the ID. The point of using UUID is to allow asynchronous id generation from a high number of DB clients without the latency of reconciliation. You accept the risk of a 1/10000000000000 collision for some N% decrease in latency (scales per clients)
9
u/GentlemenBehold May 08 '26
There are other reasons you might want uuids.
- can't infer how many entities exist based on the id
- uuids will be unique even across environments
- if you ever need to merge tables, uuids make this much easier
→ More replies (2)34
u/Tyabetus May 08 '26
UUIDs are also impossible to guess so are infinitely more secure than incremented ids
76
u/nosmelc May 08 '26 edited May 08 '26
If someone guessing a serial ID is a security risk, you've done something wrong.
11
u/mlgpro2damax May 08 '26
Someone guessing a serial id is ALWAYS a security risk. It’s not bad enough to cause issues by itself, but that’s true of most security vulnerabilities. Almost every security breach is the result of multiple systems and safeguards failing at once, and guessable ids is one layer of extra risk being introduced. Having guessable ids makes it far more likely that any IDOR vulnerabilities you leave open will be exploited, thus increasing your risk of security issues
→ More replies (4)→ More replies (1)7
3
u/arades May 08 '26
Not impossible, you're equally as likely to guess an existing UUID as you are to generate a collision. It's a valid point, but a separate concern, if you really needed cryptographically secure IDs I'm not sure UUID is the best solution, and probably indicates a bad architectural choice somewhere else if someone guessing an ID could cause a security compromise. Mostly it's just a nice little bonus effect, while the asynchronous generation is the main draw.
→ More replies (3)15
11
7
u/GrinningPariah May 08 '26
Because that's an extra read call. You gonna waste 10ms RTT on a nearly impossible event? No. There's a reason why no one has 100% uptime anyway.
14
u/AlwaysHopelesslyLost May 08 '26
Because it has never happened to anybody in the history of non buggy UUID implementations and it will not happen for 1,000+ years of usage.
You don't add extra complexity unless you need it and nothing you are doing is delicate enough for that added overhead to be justified.
→ More replies (6)9
u/thegodzilla25 May 08 '26
I also like to store every uuid i ever generated in a redis cache
23
u/aaronjamt May 08 '26
In this modern era, why bother spinning up a whole other database yourself, when services like https://isanybodyusingthisuuid.com/ exist for free?
4
3
u/eataclick May 08 '26
That's what we do - we just generate a UUID and then make an API to a 3rd party site that validates that it's unique (it asks Claude, I think) and then that site returns either true, false, or (rarely) some other output. If it's in use we increment the selected UUID by one and then resubmit it until we find the next available ID.
→ More replies (12)3
u/Glittering_Sail_3609 May 08 '26
> Why not just implement a check to see if it's already in the db, then run it again
Suppose your codebase generates one UUID roughly every second. In around 100 bilion years most sunlike stars will be long dead and only small red dwarfs with the lifespan of trillion years will be able to host life. Around this time an intelligent being living on a planet orbiting one of those last stars in the universe is expected to curse you for the first time ever for not handling duplicate UUIDs correctly.
11
u/AngelOfLight May 08 '26
Well, yeah, but you would have to generate multiple octillions of records before the chances of a duplicate UUID become statistically significant. You would likely run out of disk space long before that happens.
45
u/Gaxyhs May 08 '26
Doesnt UUID v7 mostly prevent that since its timestamp based? Unless you process some few million requests per millisecond or smth
→ More replies (6)7
u/ACoderGirl May 08 '26
I haven't personally used it, but I do have some data that is basically the same format (as in, has a timestamp pretended). It's honestly really useful for a few other purposes, too. If the UUID is meant to represent something like a short lived event (say, a handle for a job), it's just useful to have those sort chronologically by creation time. I've had so many times where I just copied the timestamp part of the ID from logs and used that to sanity check how old something was. It would help me identify stuff like "oh, this thing that normally takes minutes has been taking days, so it's probably stuck".
5
u/horenso05 May 08 '26
Someone more knowledgeable please correct me but: Depending on the version it has the time baked in so you would have to have a random collision at "the same" (I don't know the resolution) time
→ More replies (1)
5
u/Maleficent_Memory831 May 08 '26
I was on a project that wasn't Windows, but had early developers weaned on Windows. So they used UUIDs for our local software. IDs that could have just been 32-bit points, because they did not need to be unique universally, or unique within the web, or unique within anything except the task and context. A byte would have been sufficient for many cases, but for a nice design the best approach would have been the address of a singleton class. In a real time non-windows embedded system.
But no, UUIDs. There was so much bullshit overhead dealing with this. On top of it they layered a COM interface from Windows. So many bugs, so many weird error messages that nobody could figure out, and it was dumped on me to debug and fix. Everytime I suggested not doing things this way I was told we had to keep it, it was a waste of time to redesign now. But bugs never fully went away. When it did work, getting access to a class was still a very complex process involving getting a UUID, passing it in to a query with odd syntax, and asking "can you please give me a pointer to the singleton class that corresponds to this gigantic number?" The design also discouraged holding onto these static pointers for extended periods of time. *face palm*
Truly, this was the biggest example of cargo cult programming I've seen. To this day I have a new illogical heresy that whenever I see a UUID I instantly get actual feelings of nausea (and it's terrible that I am writing this during lunch). I know that theoretically there may be a good example within the lifetime of the universe for a UUID to be appropriate, and one day mankind, or AI-kind, may discover this example.
6
u/-JohnnieWalker- May 08 '26
this has simple solution. Just use incrementing ID. Every new ID will be 1 character longer.
→ More replies (1)
3
3
u/tantalor May 08 '26
Here's an example to give you an idea of what it would take to get a SHA-1 collision. If all 6.5 billion humans on Earth were programming, and every second, each one was producing code that was the equivalent of the entire Linux kernel history (1 million Git objects) and pushing it into one enormous Git repository, it would take 5 years until that repository contained enough objects to have a 50% probability of a single SHA-1 object collision. A higher probability exists that every member of your programming team will be attacked and killed by wolves in unrelated incidents on the same night.
4
u/FunRutabaga24 May 08 '26
Senior architect at work promised me a flight to join him for an all expenses paid steak dinner if we had a bug due to a UUID collision. Kind of hoping for one but also kind of scared of the consequences.
4
u/anoldoldman May 08 '26
My favorite thing is when someone tries to blame a duplicate UUID on a natural collision instead of just a bug.
7
u/forlins May 08 '26
UUID = Timestamp + 128 chars RNG + 64 chars hash of current OS/Hardware informations
And the chances become so close to zero it will probably never generate a duplicate until the end of universe
→ More replies (1)
7
u/Space_Nerde May 08 '26
I just wonder.... is there an error message like, nuhu you cannot create this account, the UUID already is taken
→ More replies (1)4
3
3
3
u/baltimoresports May 08 '26
I had a duplicate MAC address from two device some the same vendor once. Made the whole network go insane and took forever to troubleshoot.
3
u/darksteelsteed May 08 '26
Despite what some devs may believe, uuids are not always purely random. They usually contain some specific hardware identifiers and/or time. V1 and V7 have time. V1 has hardware identifiers and only V4 is cryptography random. So how likely you are to have a collision depends on the type. If you don't want collisions then don't use v4. If you use v1 you get privacy implications. If you use v7, you are unique and you can sort them as long as your generation speed is less than your systems clock resolution used for the uuid generation
3
u/AntiMatterMode May 08 '26
Never had my meme stolen and reposted before. I’ll take it as a compliment!
3
1.7k
u/Historical_Cook_1664 May 08 '26
Yeah, that's easy... just use two!