I was reading it as an endorsement for autoincrementing int primary keys and a condemnation of uuids in general which is a genuine stance I’ve known people to take. Is that not it?
Everything after this is so pointlessly condescending and confusing. Even if someone knows what monotonic ids are it doesn’t automatically mean they’re going to have any clue about what that means with regards to index performance. In the spirit of not being an asshole, I’ll write it out here based on my research since everyone else just seems interested in putting others down rather than being helpful.
“Monotonic” implies something that is always increasing (or decreasing). You’ll never get a result that’s lower than one you’ve gotten before (or higher if you’re dealing with monotonically decreasing stuff).
Random UUIDs are not monotonic because they’re random.
Even time based UUIDs are not monotonic because of the format. Rather than being store high, medium, low, they’re stored low, medium, high. Think of it like storing numbers like “1 20 300” for 321. 322 would be “2 20 300”. To make it worse, the end of them is “random” (a MAC address). So, not monotonic at all because MAC addresses can change. (See here for proposed new formats, where they mention this as a problem https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-04.html)
Monotonic primary keys are useful because they’re more easily inserted into an index because you’re always inserting into one specific part of the index rather.
Just to be clear, if a person is wrong about best practices then it’s not a big deal.
In context of spicy autocomplete as coding assistance, it better output immaculate, robust code every fucking time or we should be clowning on it with zero remorse.
agreed. we’ve veered a bit too close to slashdot’s tone on this one.
with that said, I’m also acutely aware of the tactics that programming.dev reply guys use to generate these kinds of responses. to our guests: it’s best to take your questions about database best practices literally anywhere else but here.
with that said, I’m also acutely aware of the tactics that programming.dev reply guys
I wasn’t actually aware of this, and will be taking note of it in future. for my part I tried to make my reply “uhh go look at $x and learn” post without, y’know, overtly making things into a not-meant-for-here debate setup, but that didn’t seem to have worked out entirely well :)
putting my 2¢ forward: this is a forum for making fun of overconfident techbros. i work in tech, and it is maddening to watch a massively overvalued industry buy into yet another hype bubble, kept inflated by seemingly endless amounts of money from investors and VCs. and as a result it’s rather cathartic to watch (and sneer at) said industry’s golden goose shit itself to death over and over again due to entirely foreseeable consequences of the technology they’re blindly putting billions of dollars into. this isn’t r/programming, this is Mystery Science Theater 3000.
i do not care if someone does or does not understand the nuances of database administration, schema design, indexing and performance, and different candidates for the types of primary keys. hell, i barely know just enough SQL to shoot myself in the foot, which is why i don’t try to write my own databases, in the hypothetical situation where i try to engineer a startup that “extracts web data at scale with multimodal codegen”, whatever that means.
if someone doesn’t understand, and they come in expressing confusion or asking for clarification? that’s perfectly fine – hell, if anything, i’d welcome bringing people up to speed so they can join in the laughter.
but do not come in here clueless and confidently (in)correct the people doing the sneering and expect to walk away without a couple rotten tomatoes chucked at you. if you want to do that, reddit and hacker news are thataway.
I’ve more of a math background than cs so monotonic is a word I know well but it apparently means something slightly different to me. Monotonicity isn’t mentioned anywhere in that link.
Thanks for trying to explain it. I was hung up on thinking all UUIDs looked like UUID v4. I read up a little on UUID v7 and it’s making sense. Probably should’ve done that sooner.
You’re missing the entire point of the post you replied to
I was reading it as an endorsement for autoincrementing int primary keys and a condemnation of uuids in general which is a genuine stance I’ve known people to take. Is that not it?
Everything after this is so pointlessly condescending and confusing. Even if someone knows what monotonic ids are it doesn’t automatically mean they’re going to have any clue about what that means with regards to index performance. In the spirit of not being an asshole, I’ll write it out here based on my research since everyone else just seems interested in putting others down rather than being helpful.
Yeah, I’m all for dunking on promplets, but just being wrong about best practice isn’t a big deal. The reaction here is excessively harsh.
Just to be clear, if a person is wrong about best practices then it’s not a big deal.
In context of spicy autocomplete as coding assistance, it better output immaculate, robust code every fucking time or we should be clowning on it with zero remorse.
Wait a second…to err is to be human. Programmers err sometimes. ChatGPT shits itself all the time…😟. Yud et al. were right
agreed. we’ve veered a bit too close to slashdot’s tone on this one.
with that said, I’m also acutely aware of the tactics that programming.dev reply guys use to generate these kinds of responses. to our guests: it’s best to take your questions about database best practices literally anywhere else but here.
I wasn’t actually aware of this, and will be taking note of it in future. for my part I tried to make my reply “uhh go look at $x and learn” post without, y’know, overtly making things into a not-meant-for-here debate setup, but that didn’t seem to have worked out entirely well :)
Read the sidebar. This is literally not the place.
The fuck is a side bar? My app doesn’t have that. Be more specific, please.
If your “app” cannot show basic information about the forum to which you are posting, your “app” is bad.
no, programming.dev, let’s fucking not
putting my 2¢ forward: this is a forum for making fun of overconfident techbros. i work in tech, and it is maddening to watch a massively overvalued industry buy into yet another hype bubble, kept inflated by seemingly endless amounts of money from investors and VCs. and as a result it’s rather cathartic to watch (and sneer at) said industry’s golden goose shit itself to death over and over again due to entirely foreseeable consequences of the technology they’re blindly putting billions of dollars into. this isn’t r/programming, this is Mystery Science Theater 3000.
i do not care if someone does or does not understand the nuances of database administration, schema design, indexing and performance, and different candidates for the types of primary keys. hell, i barely know just enough SQL to shoot myself in the foot, which is why i don’t try to write my own databases, in the hypothetical situation where i try to engineer a startup that “extracts web data at scale with multimodal codegen”, whatever that means.
if someone doesn’t understand, and they come in expressing confusion or asking for clarification? that’s perfectly fine – hell, if anything, i’d welcome bringing people up to speed so they can join in the laughter.
but do not come in here clueless and confidently (in)correct the people doing the sneering and expect to walk away without a couple rotten tomatoes chucked at you. if you want to do that, reddit and hacker news are thataway.
indeed, that is not it
hint: don’t try to “read in” any extra meanings. just read the actual statement that was posted.
second hint: throw “monotonic UUIDs” into your search engine of choice
Would they not have monotonic uuids after altering the code in the article to use a function or lambda as they suggested?
you might know what “monotonic” means if you had googled it, which would also give you the answer to your question
I’ve more of a math background than cs so monotonic is a word I know well but it apparently means something slightly different to me. Monotonicity isn’t mentioned anywhere in that link.
okay, for some reason, I feel the need to help.
The given link defines the function that creates a UUID:
In mathematics, can you generate a monotonic function by generating random numbers?
you are probably a better person than i am for actually giving an explanation
Thanks for trying to explain it. I was hung up on thinking all UUIDs looked like UUID v4. I read up a little on UUID v7 and it’s making sense. Probably should’ve done that sooner.
just stop digging, sheesh