How do y’all filter out survivorship bias in articles like this? I can imagine 50 other people with the exact same experiences but then having worked for companies that ended up fizzling.
It might also be people not willing to admit that they don’t know how to optimize website performance. And if you have a somewhat complex web app it can be complicated, especially if your stack doesn’t help you (looking at you React).
I think there are valuable positions to take in between “let’s manipulate the DOM by hand” and “React Server Components, NextJS and the kitchen sink”.
I personally think there’s great value in the pattern of reactivity where parts of your DOM update based on bits of data. Developing, designing and testing components like this becomes way simpler.
...but by trying to avoid the bottleneck and moving things to backend, you make things 10x worse resource wise for the DB. So it is not a easy tradeoff.
Take any computation you can do in SQL like "select sum(..) ...". Should you do that in the database, or move each item over the network and sum them in the backend?
Summing in the database uses a lot less resources FOR THE DB than the additional load the DB would get from "offloading" this to backend.
More complex operations would typically also use 10x-100x less resources if you operate on sets and amortize the B-tree lookups over 1000 items.
The answer is "it depends" and "understand what you are doing"; nothing about it is "inevitable".
Trying to avoid computing in the DB is a nice way of thinking you maxed out the DB ...on 10% of what it should be capable of.
Well, it is file IO, plus processing on top. But it's not that simple, since if your data is small enough it can all be loaded into memory, allowing you to sidestep any file IO. But you still have the processing part...
reply