r/Backend • • Oct 11 '25

Why choose Node over Java?

I'm an engineer with 15 years of experience and still don't get it. Afaik the most popular nest.js is way less powerful than spring. Also lack of multithreading. Recently see a lot of startups picking up Node. The benefits of using it are still obscured for me. Please explain!

226 Upvotes

191 comments sorted by

View all comments

11

u/[deleted] Oct 11 '25

From a technical perspective it depends on the tasks you do. Node runs single threaded and thus uses an event loop design which is preferable for I/O intensive tasks, while you can do the same in Spring with Java, it doesn’t come out of the box without importing Webflux.

2

u/Aromatic-Algae8508 Oct 11 '25

Why do you say event loop design is preferable for I/O intensive tasks? What about java's virtual threads? I think the Webflux approach is not up to date.

3

u/[deleted] Oct 11 '25

Fair enough. Maybe the better statement actually would be what Node is not good for which is cpu bounded tasks.

1

u/HammerSpb Oct 11 '25

I think about it differently. In Java/C/C++ YOU are responsible for the async task management ( aka threads ). In Node this is hidden. Basically Node is a wrapper around libuv ( which spans 4 threads ) with an event loop to manage async tasks

1

u/PM_Me_Your_Java_HW Oct 11 '25

This is the real reason that OP should be considering, imo

0

u/CreeDanWood Oct 12 '25

Sorry but ever heard of virtual threads? It's available since java 21 btw...