3 ms·
> lack of multi threading That aspect of Node.js can actually be a very good thing for serious backend work, as it encourages process decoupling using API's. D
by NathanKP 5y ago
> lack of multi threading
That aspect of Node.js can actually be a very good thing for serious backend work, as it encourages process decoupling using API's. Decoupling ends up scaling better later on: you build a distributed system that can be scaled out horizontally across a fleet, rather than running up against vertical scaling limits of how many threads you can get running on the same local hardware.
Whenever I've seen applications that use worker threads for backend systems they end up regretting it and wished they had decoupled into a separate process that could have been scaled independently onto other hardware over the network. Spinning up new threads on the same machine is a temporary crutch that bites you later on in your growth.
- ratorx 5y agoI’ve seen plenty of serious backends that use multiple threads and are horizontally scaled. I don’t think this is a particularly compelling argument for the lack of multi-threading. The worker thread pattern is fairly useful and there is no reason a well architected application couldn’t use both horizontal and vertical scaling. Independent scaling is only really useful if there is a large variation in the amount of work done by the workers per query. If it’s well bounded, then it might be easier to just horizontally scale the entire backend. There are also other use cases for threads that don’t fit into the worker pattern. For example, background tasks that happen outside the serving path.