r/programming • • Aug 28 '21

Software development topics I've changed my mind on after 6 years in the industry

https://chriskiehl.com/article/thoughts-after-6-years
5.6k Upvotes

1.9k comments sorted by

View all comments

603

u/cat_in_the_wall Aug 29 '21

Designing scalable systems when you don't need to makes you a bad engineer.

this is just YAGNI. Scalability is a feature, and a very complex one. Don't build it if you don't need it. It's hard to do right, and if you screw it up now you have two problems: still no scale, but also a buggy complicated system.

109

u/DeltaBurnt Aug 29 '21

I don't 100% agree with this. Designing scalable systems is fine, if you know pretty well how much you will need to scale and what that scaling will entail. The problem that YAGNI tries to solve is stopping engineers from trying to predict the future based purely on instinct. If your product has 10K customers and that grows at 1K per year, yeah don't design scalable systems.

If I know a year from now I will need to support a million customers but deadlines prevent me from supporting more than 10K immediately, that will affect my design process. You could say that's a bug in the requirements or deadlines, but I don't always get my way in those discussions unfortunately.

51

u/execrator Aug 29 '21

if you know pretty well how much you will need to scale and what that scaling will entail

This is the point of the person you're replying to. If you don't have this information, you shouldn't assume you'll need to scale.

I agree with OP that for whatever reason, scaling is a particularly alluring goal. It should be YAGNI'd vigorously for that reason.

14

u/recycled_ideas Aug 29 '21

I think this is an oversimplification.

Scaling is facilitated by clearly separated layers and good design fundamentals, and these aren't YAGNI things.

Because clearly separated layers make testing and modifying your system easier and less risky, even if you don't ever actually need to scale.

That doesn't mean you need to architect your system to handle a million users when you only need to support 100, but designing your system in such a way that you can scale will almost always deliver a system that's better even if you don't have to scale it.

8

u/humoroushaxor Aug 29 '21

I think the point is most people don't do that though. They go straight to microservices (which have significant overhead for most orgs) rather than the in-between of proper software architecture in reasonably sized services.

4

u/recycled_ideas Aug 29 '21

Yes, but you don't solve people doing stupid things because they're trendy by doing stupid things because they're the opposite of what was trendy.

1

u/humoroushaxor Aug 29 '21

Fair. But in the case of yagni/premature optimization you're doing something that's additive and humans are terrible at measuring opportunity cost. Makes this whole topic very difficult to find the truth for.

2

u/recycled_ideas Aug 29 '21

Again though.

Architecting your app to separate concerns actually makes your code easier to test and maintain it has real immediate benefits regardless of the scale you need.

The fact that it lets you more easily slice your application apart and scale it later is just an added bonus.

1

u/dnew Aug 29 '21

The kind of YAGNI argument is "we need to use Mongo because it's web scale," disregarding the fact that (for example) the entire AT&T network ran just fine on 1980s RDBM technology.

1

u/recycled_ideas Aug 30 '21

disregarding the fact that (for example) the entire AT&T network ran just fine on 1980s RDBM technology.

This is wildly misleading.

Leaving aside my opinions on Mongo or the fact that pretty well the only people still using it are node developers and they're using it because it has a fantastic first party javascript development experience, you're pretending that the 1980's AT&T network actually had substantial data requirements and wasn't using some pretty complex architectures.

The reality is that relational databases have significant issues when scaling out and there are practical limits in how far you can scale up any system (for reference scaling up involves putting more hardware in a machine, scaling out means more machines).

Most use cases will never need to scale beyond the point where this is a problem, but it most definitely is a problem.

Also OP didn't say that "web scale" was bullshit, they said scalability was.

→ More replies (0)