Live data from Hacker News

Spending $5k to learn how database indexes work

briananglin.me

101–110 of 209 posts

Re: Spending $5k to learn how database indexes work

#101
post #90

I'm just leaving this here: https://www.hetzner.com/dedicated-rootserver/ax161/configura... Draw that nice red slide all the way to the right. No, it's not storage. Yeah, it's actually affordable. Yeah, that was a sexual sound you just made. You do have to be prepared to know some basic sysadmin, or pay somebody to do it for you. My newest server has about 60 cores and half a tera of ram. Surprisingly, it's not uber…

...and Hetzner just started offering their services in the US a few days ago. (EDIT: not affiliated) If you do something stupid with your code at least you won't go bankrupt, only your service will be slower.

I was just comparing the pricing to OVH's cloud VPS's (https://us.ovhcloud.com/) and, accounting for the currency conversion and OVH's huge amount of free unmetered bandwidth (vs 20TB for H), it actually looks like OVH is even cheaper.

How can DO and Vultr even compete? Probably on the basis of their nicer dashboards and easier sign-up flow (especially OVH's)

Re: Spending $5k to learn how database indexes work

#102
post #14

I feel like indexes are a pretty fundamental type of DB knowledge. In fact I'd say it's table stakes knowledge you should have if you're working with them. Further more, knowing that ForeignKeys typically apply an index to that column is also in my head basic knowledge. I'm sorry you got burnt, and congrats on learning a lesson, but you could have gotten the same knowledge by ever googling MySql ForeignKeys and saved…

I've been using relational databases for web apps for my entire career and probably would have made this same mistake if using PlanetScale for the first time.

The author had two misunderstandings:

1) An index isn't created automatically

2) You get billed for the number of rows scanned, not the number of rows returned

Even if I noticed #1, I probably wouldn't have guessed at #2 for the same reason as the author.

Re: Spending $5k to learn how database indexes work

#103
post #90

I'm just leaving this here: https://www.hetzner.com/dedicated-rootserver/ax161/configura... Draw that nice red slide all the way to the right. No, it's not storage. Yeah, it's actually affordable. Yeah, that was a sexual sound you just made. You do have to be prepared to know some basic sysadmin, or pay somebody to do it for you. My newest server has about 60 cores and half a tera of ram. Surprisingly, it's not uber…

...and Hetzner just started offering their services in the US a few days ago. (EDIT: not affiliated) If you do something stupid with your code at least you won't go bankrupt, only your service will be slower.

Oooooooooh!

Re: Spending $5k to learn how database indexes work

#104
post #90

I'm just leaving this here: https://www.hetzner.com/dedicated-rootserver/ax161/configura... Draw that nice red slide all the way to the right. No, it's not storage. Yeah, it's actually affordable. Yeah, that was a sexual sound you just made. You do have to be prepared to know some basic sysadmin, or pay somebody to do it for you. My newest server has about 60 cores and half a tera of ram. Surprisingly, it's not uber…

...and Hetzner just started offering their services in the US a few days ago. (EDIT: not affiliated) If you do something stupid with your code at least you won't go bankrupt, only your service will be slower.

Just to clarify, Hetzner now has Cloud servers in the US. Dedicated servers are still only available in Europe.

Re: Spending $5k to learn how database indexes work

#105
post #45
post #6

Earlier quoted context omitted.

It's not quite so crazy when you phrase it as $0.15 for reading a million items from the database .

Still crazy, charging $0.15 for probably less than a few ms of computing power.

If those million items need to be read from different servers -- as they might well, in a distributed database -- it's definitely not just a few ms of computing power.

For reference, reading a million items of up to 1 kB each costs $0.125 with on-demand dynamodb.

Re: Spending $5k to learn how database indexes work

#107
post #99

Earlier quoted context omitted.

> When I deploy something that unintentionally causes a large monetary bill to my employer, then yes I do believe that indicates a gap in knowledge so I don't in anyway believe I'm being uncharitable. It depends, if you've been given a loaded footgun it's not entirely your fault when it inevitably goes off. Let's go back to your "compiler errors" scenario, and let's say someone decided that the company should be usin…

I am somewhat shocked to find that an RDBMS is considered a “loaded footgun” in 2021. Perhaps grandparent isn’t the most charitable in their interpretation, but I am in full agreement. It continues to astound me how little about the basics of databases most developers know, and how strongly resistant they are to trying to learn.

An RDBMS that scales infinitely while charging you per-row goes against the usual assumptions learned in the past decades, so I'd say yes that's a loaded footgun.

Re: Spending $5k to learn how database indexes work

#108
post #90

Earlier quoted context omitted.

...and Hetzner just started offering their services in the US a few days ago. (EDIT: not affiliated) If you do something stupid with your code at least you won't go bankrupt, only your service will be slower.

I was just comparing the pricing to OVH's cloud VPS's ( https://us.ovhcloud.com/ ) and, accounting for the currency conversion and OVH's huge amount of free unmetered bandwidth (vs 20TB for H), it actually looks like OVH is even cheaper. How can DO and Vultr even compete? Probably on the basis of their nicer dashboards and easier sign-up flow (especially OVH's)

Tried OVH once. Couldn't even finish the account setup. Was rather dissapointed because I wanted not to depend on just one provider. Might give them a chance again.

Re: Spending $5k to learn how database indexes work

#109
post #90

Earlier quoted context omitted.

...and Hetzner just started offering their services in the US a few days ago. (EDIT: not affiliated) If you do something stupid with your code at least you won't go bankrupt, only your service will be slower.

I was just comparing the pricing to OVH's cloud VPS's ( https://us.ovhcloud.com/ ) and, accounting for the currency conversion and OVH's huge amount of free unmetered bandwidth (vs 20TB for H), it actually looks like OVH is even cheaper. How can DO and Vultr even compete? Probably on the basis of their nicer dashboards and easier sign-up flow (especially OVH's)

I think Hetzner removed their traffic limit for dedicated servers https://www.hetzner.com/news/traffic-limit/

Re: Spending $5k to learn how database indexes work

#110
post #95

Earlier quoted context omitted.

No I did, but since I disagree with your earlier point about how much existing knowledge they have it kind of by default means I disagree with what they took away from this incident. It's also highly speculative so like I'm not going to go back and forth on it. Needing a vendor to hand hold your likely highly paid dev seems like a bad fix to me. Also not having an index isn't an error it can be a valid choice based o…

> I know we disagree, I know you're going to continue disagreeing, I know I don't want to have the conversation. Please consider not chiming in on the next article like this then. I think your attitude of (paraphrasing) "no good programmer would have made the costly mistake you shared, and articles about it aren't worthwhile" is super harmful to our industry. It's the polar opposite of the blameless postmortem approa…

This one in particular is not worthwhile on the front page of HN, that's my take. They're most definitely useful for beginners, or maybe people just learning about databases.

I'm not going to not post simply because you find it disagreeable, there are plenty of people here who seem to agree with me.

Blameless post mortems are great, for your team. I am not his team mate, and I don't really feel a kinship with every developer under the sun. And for what it's worth I don't blame this developer for anything. If anything I lament the institutions that failed them on the way to this point in time. To me this is a symptom of systemic rot.

Post reply on HN