Live data from Hacker News

Spending $5k to learn how database indexes work

briananglin.me

41–50 of 209 posts

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

#41
post #10

No foreign keys to make migrations easier. That doesn't sound like the best trade off to me. Having the database constrained as much as possible makes maintenance so much easier. Many bugs don't escape into production as they're caught by the database constraints. Those that do get out do less damage to the data. I know scale comes with trade offs but that seems extreme to me.

I'm a Vitess maintainer and I feel the same way. I don't plan to use any of the Online DDL because you'll have to pry my foreign keys out of my cold, dead hands. I understand the reasoning and limitations, but like you, the trade-off isn't worth it to me.

I'm so curious, so you maintain Vitess but don't use it personally?

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

#42
post #36

Earlier quoted context omitted.

> I'm not entirely sure why buzz around "developer learns basic knowledge" has this on the front page. The problem is that in the old days, not knowing about indexes left you with an underperforming system or downtime. But in The Cloud™ it leaves you with an unreasonably huge bill and that somehow as an industry we're accepting this as normal.

Which really is a head scratcher. You'd figure especially as a startup seeing a 5k oopsie isn't really as acceptable. Mistakes do happen and I don't mean any shade to this particular person (they'll never make this mistake again) but as an industry the aggregate consequence of this is you have a lot of waste and stupid choices that then have to be cleaned up when more knowledgeable (read highly paid) people are intro…

I have no problems with a developer doing a 5k oopsie with things like card processing or an area that has a legitimate potential for direct monetary losses (such as payment processing where a bug could allow customers to order goods without actually paying).

I have a problem with whoever looked at and said "nah, let's go with a cloud-based solution that charges per-query and gives us an essentially infinite financial liability".

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

#43
post #10

No foreign keys to make migrations easier. That doesn't sound like the best trade off to me. Having the database constrained as much as possible makes maintenance so much easier. Many bugs don't escape into production as they're caught by the database constraints. Those that do get out do less damage to the data. I know scale comes with trade offs but that seems extreme to me.

I'm a Vitess maintainer and I feel the same way. I don't plan to use any of the Online DDL because you'll have to pry my foreign keys out of my cold, dead hands. I understand the reasoning and limitations, but like you, the trade-off isn't worth it to me.

What are your thoughts on Citus and Cockroach where foreign keys are still supported when creating partitioned clusters?

Is due to fundamental differences in postgres vs innodb?

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

#44
post #27

Earlier quoted context omitted.

It's better than targetted ads built on intrusive tracking that also enables several other abusive business practices. It's not better than "good old fashioned ads". Heck I'd even be ok with targeted ads if it could be done without the rest of the "destroy civil society" that seems to come along for the ride.

Even if you solve the privacy problem, there's still a problem with advertising which is that it's inherently at odds with the user's interests. An advertising-funded product will always prioritize engagement - they want you to "engage" with the product even if it means degrading the experience intentionally such as making a process manual or take more steps than necessary (so that you are exposed to more ads). The "…

You're assuming it's either/or. When I worked at eHarmony we had a monitor that would scroll user feedback submitted online near the developer area. One of the most common complaints was about ads being shown to paid users.

I asked a PM about this and was told that the money they made was too much to turn down.

Capitalism. It's why we can't have nice things.

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

#45
post #6

0,15 $ per query... The world has gone insane.

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.

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

#46
post #4
post #3

Huh, learning about this "Superwall" product constitutes as my horror-story-of-the-day. It's paywalling as a service, just what the industry needed. Thankfully it appears to be quarantined to iOS right now, but God does it feel like we're headed right back into Stallman's predictions about how SAASS will ruin the landscape of commercial technology.

Two sides to every coin. Ethical developers need ways to make low prices work, which is impossible without good testing suites.

These days, if you're developing something for profit it's pretty hard to see your software as ethical. You're either trying to empower your user or trying to monetize them, the two will always fight one another and snuff the other out unless you, the developer, take a stand.I fully understand the market for proprietary software, but trying to define some ethical middle ground is just blatant lip service, nothing else.

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

#47
post #44

Earlier quoted context omitted.

Even if you solve the privacy problem, there's still a problem with advertising which is that it's inherently at odds with the user's interests. An advertising-funded product will always prioritize engagement - they want you to "engage" with the product even if it means degrading the experience intentionally such as making a process manual or take more steps than necessary (so that you are exposed to more ads). The "…

You're assuming it's either/or. When I worked at eHarmony we had a monitor that would scroll user feedback submitted online near the developer area. One of the most common complaints was about ads being shown to paid users. I asked a PM about this and was told that the money they made was too much to turn down. Capitalism. It's why we can't have nice things.

I don't disagree with that, but that's still not a reason to turn down paid options. With ads, you are guaranteed to get a bad experience. With paid product, there is potential for a bad experience, but at least it's not the guaranteed default.

Regulation around ads is the only definitive solution, but in the meantime if there's a business model that's non-toxic I'm not going to hate on it even if technically someone could still misuse it.

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

#48
I was actually considering PlanetScale, but them saying "Every time a query retrieves a row from the database, it is counted as a row read." when it's actually all the scanned rows, sounds intentionally confusing. "Retrieving" sounds like it should only be counted rows returned by a query.

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

#49
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…

they were using some kind of foreign keyless MySQLish whatever thing

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

#50
post #36

Earlier quoted context omitted.

> I'm not entirely sure why buzz around "developer learns basic knowledge" has this on the front page. The problem is that in the old days, not knowing about indexes left you with an underperforming system or downtime. But in The Cloud™ it leaves you with an unreasonably huge bill and that somehow as an industry we're accepting this as normal.

Which really is a head scratcher. You'd figure especially as a startup seeing a 5k oopsie isn't really as acceptable. Mistakes do happen and I don't mean any shade to this particular person (they'll never make this mistake again) but as an industry the aggregate consequence of this is you have a lot of waste and stupid choices that then have to be cleaned up when more knowledgeable (read highly paid) people are intro…

The best technical people aren't always the best to start a business. The goal is to make money not have perfect code.
Post reply on HN