Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

ffs, this attitude causes massively more problems than it solves.

1. You can always change later. Uber switched from Postgres to MySQL when they had already achieved massive scale.

2. You don't know what scaling problems you're going to get until you've scaled.

3. Systems designed to scale properly sacrifice other abilities in order to do that. You're actively hurting your velocity with this attitude.

4. Every single expert in the field who has done this, says to start with a monolith and break it out into microservices as the product matures. Yet every startup is founding on K8s because "we'll need it when we hit scale so we might as well start with it"

5. Twitter's Fail Whale - the problems that failing to scale properly bring are less than the problems of not being flexible enough in the early stages.

Build it simple, and adapt it as you go. Messing up your architecture and slowing down your development now to cope with a problem you don't have is crazy.



> You don't know what scaling problems you're going to get until you've scaled.

This is the point I keep repeating.

If you find yourself needing to scale, the way you scale likely does not match what anyone else is doing. The way Netflix scaled does not look anything like the way WhatsApp scaled. The application dictates the architecture. Not the other way around. Netflix started as a DVD service. Their primary scaling concerns were probably keeping a LAMP stack running and how the hell to organize, ship, and receive thousands of DVDs a day. These scaling problems have little in common with their current, streaming, scaling problems.

It's a weird thing that developers love to discuss and hype up scale and scaling technology and then turn around and warn against the dangers of premature optimization in code. If you ask me, the mother of all premature optimization is scaling out your architecture to multiple servers, sharding when you don't need to, dealing with load balancing, multiple security layers, availability, redundancy, data consistency, containers, container orchestration, etc. All for a system that could, realistically, run quite adequately on an off-the-shelf Best Buy laptop. We have gigabit ethernet and USB 3 on a Raspberry Pi today and people are still shocked you could run a site like HN off a single server. We've all been lobotomized by the cloud hype of the 2010s that we can't even function without AWS holding our hand.


I am partial to the "don't solve problems you don't have" argument which holds true in a lot of cases.

That said, the database is the one part of the system that is very tricky to evolve after the fact. Data migrations are hard. It's worth investing a little bit of time upfront to get it right.


> Data migrations are hard.

Yes, which is exactly why you shouldn't go with a highly scalable database solution. All of the solutions for really big scale involve storing data in non-normalised form, which mean the pain of data migrations frequently while developing features.

Best to avoid this until you have to.


Agree entirely. You're going to have to migrate anyway. May as well migrate from a database that's easy to work with.


Don't do anything obviously complex with your RDBMS and migrations are free. If all you need is a few views, tables and FKs, then migration between RDBMS' should be low effort if you have a decent RSM or ORM to plug behind it. And even with more efforted things, I've written low-effort migrations from and to various RDBMS', it's not black magic.

The little time upfront is "use pgsql unless there is a good reason not to" as your first choice.


if you dont change schema dramatically, then it doesnt make much sense to migrate to another RDBMS, because most engines have pretty much similar query planner (if you not doing "anything obviously complex").

if you do migrate due to scaling issues, then the schema must evolve, for example: add in-memory db for caching, db sharding/partitioning, table partitioning, hot/cold data split, OLTP/OLAP split, etc.


Scaling issues can present themselves in numerous ways which may not require an in-memory DB, sharding/partitioning, hot/cold or such to be changed, they may even be already present.

In a lot of cases, these can be used and added without locking you out of migration since parts of these are deeper application level or just DB side. The query planner isn't the end-all of performance, there is plenty of differences between MySQL and PgSQL performance behaviour that might force you to switch even though the query planner won't drastically change things.


I have not seen comments about technical debt. I think you are right: It is good to take shortcuts to ship faster. When you do that, you accumulate technical debt. I think it is important to identify it and to remain aware of this debt. I've seen too many people in denial who resist change.


It's not even tech debt. It's like a "tech short" - assuming you'll have this specific scaling problem in the future, and paying the cost now.


"Tech short" - I love it. I'm going to use that.


ffs, this attitude causes massively more problems than it solves.

I don't think that it causes so many problems to just use MySQL instead of Postgres from the very beginning of a project. I like using Postgres and I understand that I shouldn't care about scaling but if a make a good decision from the very beginning it can't hurt.


I would rather use Postgres and have a RDBMS that is quite strict and migrate data later instead of having a RDBMS that just does what it likes sometimes.

For example, query your table „picture“ with a first column „uuid“ (varchar) with the following query:

SELECT * FROM picture WHERE uuid = 123;

I don‘t know what you expect, I expect the query to fail because a number is not a string. MySQL thinks otherwise.


In Oracle it will fail, but only if uuid has characters that can't be parsed as numbers...


Does that make it better? IMHO, it‘s even worse.


Uber switched because of a very specific problem they had with the internals of Postgres, that was handled differently in MySQL (which I believe is now "solved" anyway).

It's not that MySQL scales better than Postgres, but that Uber hit a particular specific scaling problem that they could solve by switching to MySQL.

You could well use MySQL "because it scales better" and then hit a particular specific problem that would be solved by switching to Postgres.


Is MySQL a general solution to scaling? What if your scaling problem is with writes?


That's why Vitess is so awesome - you can scale writes infinitely. There's not a truly comparable option for Postgres




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: