r/Backend • u/Resident-Hunt-245 • 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!
57
u/Enforcerboy Oct 11 '25
Mostly startups pick node is because there is an enormous talent pool of node devs compared to that of spring ( or java ) , secondly being someone who transitioned to nest from spring, yes nest isn’t that popular but it also has fair enough ecosystem.
From an Engineer’s POV, Node isn’t build for anything CPU intensive or anything which could block it’s main thread, yes it provides you worker threads option but they aren’t that useful ( in my opinion ) , if you have any task that could block the CPU then in node more often you will have to go with event based approach.
Where Node really shines is for I/O ops, but from what I remember, they are bringing something similar to Java as well where IO calls won’t block the thread execution.
And personally I prefer Java if I know that my usecase will involve a lot of looping tasks , and I know project is gonna grow very significantly and I know that my app would receive very high traffic but for POC, MVP, or even production grade apps where I have enough resources to scale my containers, I like node (nestjs) it’s faster for me to work in.
2
u/Desperate-Credit-164 Apr 13 '26
I have a question. I hope you can help me out.
For an event-driven, serverless system (a mobile app) with few users, low workload for heavy tasks (almost nonexistent), and a very small development team (3 devs) but with critical tasks for the medical sector (an app for monitoring hospital alarms), which is the better choice from a professional standpoint? Java or Node? Spring Boot or NestJs?
Thanks in advance.
1
u/Enforcerboy May 04 '26
For your usecase I would pick NestJs, doing the same in spring would be of too much hassle,
Although paradigm wise both of them are same, but I tend to like docs of Nestjs more.
1
1
u/zaibuf Oct 14 '25
Java is also a proper OOP and typed language. While you can use TypeScript it still doesn't solve all issues. Nothing but a PR will stop a dev from ignoring eslint rules and just do "any".
1
1
u/metalisticpain Oct 15 '25
Talent is a strong word... Mid FE engineers calling themselves full stack...
7
Oct 11 '25
[removed] — view removed comment
3
u/behusbwj Oct 11 '25
Virtual threads. Node implemented it from the get-go as rhe event loop
6
u/SpeakCodeToMe Oct 12 '25
The event loop and virtual threads are wildly different.
2
u/behusbwj Oct 12 '25
Everything is “wildly different” if you go into enough detail. They solve very similar problems in very similar ways. That’s enough for this level of discussion, and they can go look it up if they want to know more about the implementations.
1
u/TomKavees Oct 12 '25
No, they really are in the context of this thread - the developer experience is significantly different.
With virtual threads you can write naive single threaded code with all error handling you want and the jvm will automatically split it into different continuations at io calls, while in javascript land you have to deal with callbacks
4
2
2
u/FarkCookies Oct 13 '25
Not really, you can say virtual threads arrived with async/await syntax. Before it was callback hell, hardly virtual threads. Virtual threads are a linguistic facade hiding what is async behind linear code. Node was nothing like that "from the get-go", quite the contrary, the fact that IO is async was thrown in your face as the callback soup.
1
u/HammerSpb Oct 11 '25
By default you have 4 threads via libuv underneath a single node process.
4
u/Expensive_Garden2993 Oct 11 '25
Those theads aren't used for http or db calls. So if you make 1000 db calls, it won't block the main thread, nor those 4 threads. Those are for DNS, fs, crypto.
1
u/Enforcerboy Oct 12 '25
EXACTLYYYYYYYY !! T_T people are not understanding it, I agree it’s bit confusing to grasp at first though.
btw in your examples you can include, if we make any c/cpp addon for nodejs, it’s also executed via libuv
3
u/MrDilbert Oct 12 '25
You can also configure the number of threads available through libuv, so that you can utilize all available cores on your processor.
-1
u/Enforcerboy Oct 11 '25
Assuming you have a use case where you need to execute 1000 long running DB calls, in case of Java it will block those 1000 threads till response has not been returned but in case of Node, your main thread will get free after it has made call to DB to receive more requests, Or at places where you need a lot of file reads, basically anything where your 99% of the time will be spent in async tasks like network calls etc, that’s where nodejs shines at
8
u/AdOrnery1043 Oct 11 '25
you have no idea what you’re talking about
3
u/Enforcerboy Oct 12 '25 edited Oct 12 '25
Good sir, what do you think happens when you make a DB call or an API call from node?
When you make a API call from node, Host gets resolved using a DNS query that is made by libuv -> After that request is delegated to I/O queue of the event loop, where it’s waiting for the response ( here, nodejs using libuv transfers the request to OS using Kqueue or epoll ) -> after transferring the request to OS, main thread and libuv thread becomes free -> once response is returned the request is Os transfers the request back to libuv which in turn puts it back to the respective evenr queue ->
during next main thread execution, it picks up the event -> puts it to the promise queue ( part of micro task queue )
That’s how even 1000 long running DB queries won’t affect or block nodejs, if my understanding is incorrect please correct !
libuv threads are blocked by certain operations only : DNS lookup, file I/O , cpp addons and there is one more
Thank you
2
u/HammerSpb Oct 11 '25
Yeap, agree! If you run 1000 long running async tasks inside the node then it will behave differently. Do not forget that node is using libuv with 4 threads by default
1
u/Enforcerboy Oct 12 '25
I have just replied above how libuv won’t be blocked here, read my reply above,
Tldr; Network calls in Node js are non blocking, only certain operations like DNS lookup, file reads ( I think ) etc blocks libuv
1
u/FarkCookies Oct 13 '25
What happens to those DB calls depends on your DB driver. Those 4 threads are not consumed by IO. So either the implementation will use a separate thread pool (or connection pool) for IO or use some async IO libraries that do not need multiple threads at all. If you have a connection pool there will be some queue of db requests and they will be multiplexed over the connection pool, nobody gonna send 1000 db requests simultaneously. But all of that will be hidden from your code, so from the code logic, it will look like you made 1000 simultaneous db requests and your code flow is waiting for the result.
2
u/FarkCookies Oct 13 '25
You are right on a high level, it seems like people just don't get it.
1
u/Enforcerboy Oct 14 '25
😅 it’s fine, I don’t blame them, I assume a couple of people are junior engineers or new to node world, and I completely understand, it’s tricky to comprehend it’s working.
2
u/rrrodzilla Oct 25 '25
You’re assuming something like traditional synchronous Java like Spring MVC with JDBC which isn’t a fair comparison with async Node. Modern frameworks like Reactive Java support non-blocking IO like Spring Webflux with R2DBC. If the workload requires heavy CPU-bound tasks then Java’s native multithreading is going to outperform Node’s single-threaded event loop. Either way the answer to OPs question boils down to talent availability, tech requirements, and ecosystem maturity for whatever the use case is.
26
u/Prodigle Oct 11 '25
Most modern web back-ends are IO strained, not CPU, and node handles IO *really, really well*
Node/JS is very productive to work in nowadays, and has a really extensive (and easy to use) ecosystem
Typescript especially has *easily* the most comprehensive and great type system of anything I've ever worked with. The fact it's built on top of a dynamic language is insane, but there you go.
Backend/Frontend using the same language means most of your data classes and libraries can be defined once and shared between both projects
The most barebones express.js web server is a very small amount of code to understand, and frameworks exist for larger things, so you can build at essentially any scale/demand and be okay
That's the majority of it.
1
u/notoriousrogerpink Oct 13 '25
I find it incredibly difficult to believe anyone would willingly point to Typescript as a good type system u less they literally hadn’t used anything else out there… it’s impressive with what they were able to do no doubt but it’s not in anyway good let alone a leading example.
2
u/Sea-Quail-5296 Oct 13 '25
Yeah try C# then talk to me about a good type system. TS makes JS bearable in terms of type safety and it’s an amazing accomplishment if you think about what lies beneath
1
u/DizzyAmphibian309 Oct 15 '25
Typescript and C# were created by the same company, so they definitely incorporated all their lessons learned from C# into Typescript. I haven't encountered anything I could do in C# that I haven't been able to do in Typescript, but there's plenty of things I can do in Typescript that I can't do in C#.
1
1
u/Prodigle Oct 14 '25
Having to deal with JSON in C# enough times led me to really valuing being able to turn on and off various parts of the type system really easily.
If you're making a lib you can make it absolutely bulletproof at "compile" time with what it will accept. If you're mid-development of something less critical you can bin most of it and be productive.
Traditional typed languages give you more bulletproof guarantees, but nowadays I find you really do pay for them.
1
u/Theendangeredmoose Oct 15 '25
really?
I've worked with a number of typed languages - Java, Go, Rust and Typescript. I'd argue Typescripts is leagues ahead of Go's, better than Java's, and marginally worse than Rusts. I do love the flexibility that TS' type system has over Rusts, which I find useful for backend web dev.
what makes you say it's not good?
1
u/notoriousrogerpink Oct 15 '25
For a number of reasons. Most importantly I would say that it’s not sound and you can’t actually trust it would be the number one reason. But secondly it’s filled with some incredibly incredibly weird stuff like this: https://www.typescriptlang.org/docs/handbook/mixins.html
Compare and contrast this with another language which also compiles to JavaScript but has a genuinely great type system: https://dart.dev/language/mixins
1
u/coraythan Apr 19 '26
I mean I prefer Kotlin myself. But sometimes when I go back to Kotlin for personal projects (TypeScript pays the bills) I find myself frustrated by the inflexibility and lack of expressiveness of more formal typed languages.
Things like union types and implicit types are nice and convenient in TypeScript.
Honestly at this point after like 13 years as a developer, and having always been a very object-oriented and compile time safety kinda dev, I prefer TypeScript's type system over others. The things I miss from Kotlin when I use TypeScript are just things like extension functions, better null-handling operations, more comprehensive standard library, better functional programming options, better Collections types and stuff like that.
1
u/Bandidos_in Oct 12 '25
Why not jump a couple of steps ahead and move to python?
8
u/Prodigle Oct 12 '25
I find Python a little clunkier and less productive than Node at most of the above. I don't think there's a massive difference, though.
2
u/candraa6 Oct 13 '25
python dependency management is a nightmare tbh.
in node you can npm install and everything mostly works fine, but in python, for god sake it could brick your system, sometimes it need building native packages (and often failed), etc.
conda somewhat ease them a bit, but yeah, still a nightmare.
call me skill issue, but I have bitten many times by this python dependency management
1
u/Late_Film_1901 Oct 15 '25
Must be a skill issue as I had at most a handful of problems with python dependencies which is dwarfed by the clusterfuck of npm hell that I have to fight regularly. And I'm not even a python dev.
2
u/ReticulatedSpline78 Oct 17 '25
Python devs will admit that dependencies are terrible in python. That’s why venv needed to be invented, and it mucks with your shell variables. Yuck.
The core ethos of python is a language that has “batteries included”, and you can get very far writing python code using its built in functions and not needing dependencies. The second you do though (like a web server… you can do it in vanilla python but no one in their right mind would), it’s very ill-thought out: it’s flat (two dependencies that have conflicting sub dependencies will clash), and dependencies are stored in some system directly by default (which means more clashes if you work on multiple projects). Pip can break on minor version updates. I’ve seen python code break on minor interpreter version updates. You have very little control over how the user installs your package.
Node and the Js ecosystem on the other hand, because the core is so slim and you basically have to install dependencies to be productive, has a dependency management system forged in fire. All dependencies are stored in a subfolder of the working directory so working on a different project in another folder cannot affect it in any way (unless you’re doing npm link stuff). Sub dependencies can have different versions of the same dependency and it still works.
I will admit, with uv, python is getting better, but again, its adding yet another installation method for a language who’s selling point is that there is “one correct way to do something”.
2
u/Lughz1n Oct 13 '25
because python didn’t start with concurrency for web servers in mind. Yes nowadays there is async and things like gunicorn can deal with multiple requests concurrently, but most dependencies you use that weren’t created recently will not use async code, so if they do IO there’s no way for gunicorn to know to unblock other “threads”
ex: db client lib will send query request but not using the new async compatible lib, so gunicorn won’t know that it could process other requests while waiting for db response
1
-2
u/Odd-General8554 Oct 12 '25
AI answer spotted ☝️
6
1
u/vanit Oct 14 '25
I mean, usually emoji is the dead give away on AI posts so by that reasoning.....
45
u/ThatFlamenguistaDude Oct 11 '25
the real reason is that you get to reuse the same frontend developers that already know javascript, for backend stuff.
54
Oct 11 '25 edited Oct 11 '25
I know typescript
I don't know Java
the end.
having one language all the way through your entire company makes you a very flexible company. The performance difference between the two is just not large enough to care in 99.9999999% of case
1
u/TobiasMcTelson Oct 11 '25
lol, until you need some power processing like multi thread and has … node
4
Oct 11 '25
nodes multi threaded but to your main point, you offload that work to a different server, written in something else.
2
u/MrDilbert Oct 12 '25
Doesn't even have to be a different server - you can run a process on the same machine through worker_threads and communicate through IPC
0
u/scavno Oct 15 '25
But then it’s a sifrene language, and you just proved what a lot of us already knew. “Same language” is just bullshit.
3
u/SamWest98 Oct 11 '25 edited Feb 25 '26
[Deleted
3
u/SpeakCodeToMe Oct 12 '25
And my Swiss army knife has a drill but I'm never going to use it cause it's a piece of shit.
2
u/SamWest98 Oct 12 '25 edited Feb 25 '26
[Deleted
-2
u/SpeakCodeToMe Oct 12 '25
I'm not sure how C is relevant in this conversation.
3
u/SamWest98 Oct 12 '25 edited Feb 19 '26
[Removed]
-4
u/SpeakCodeToMe Oct 12 '25
No YOU have no idea what you're talking about LMFAO
2
u/SamWest98 Oct 12 '25 edited Feb 19 '26
[Removed]
-3
u/SpeakCodeToMe Oct 12 '25
Nah, I'll stick with the big boy toys. You enjoy your Tonka trucks.
→ More replies (0)1
23
u/Realjayvince Oct 11 '25
I love how everyone is talking about performance… unless you have a shit load of active users, it won’t matter.
The REAL and ONLY reason companies would choose node is because the talent pool is vast and not as expensive as Java. That’s it buddy… everyone talking about I/O.. 99% of times it won’t matter. It’s just the talent pool
10
u/AdOrnery1043 Oct 11 '25
Java has amazing nio, can we please move on - so cliche reading this bs in 2025
0
u/SpeakCodeToMe Oct 12 '25
It does matter though.
Your services are slower and users notice.
You need far more servers to run the same systems, that costs your company money.
People don't think it matters because they don't directly see the consequences, but it does.
2
u/sitabjaaa Oct 12 '25
Microservices exists bro then we have clustering in node js and also you can increase the worker threads of node js that solves your multi threading problem.
1
u/SpeakCodeToMe Oct 12 '25
Microservices exists bro
And that makes your code faster how?
you can increase the worker threads of node js that solves your multi threading problem.
"Just throw more threads at it bro!" 🤡
4
1
u/1Kakihara1 Oct 15 '25
Do you even understand microservices?
1
u/sitabjaaa Oct 15 '25
Yup keeping seperating each services that performs a particular function rather than keeping all of them at a particular place like the monolith architecture.
1
u/FarkCookies Oct 13 '25
I have never been at a place where shaving off of CPU consumption for web requests was a financial bottleneck.
1
u/SpeakCodeToMe Oct 14 '25
Then you've never been at a place moving much data or doing much compute.
That's okay, plenty of companies are just websites with apis and a database. There's a lot more money to be had working on bigger problems though.
1
u/FarkCookies Oct 14 '25
I have been, but that's not what we are talking about. I specifically mentioned "web requests", not "moving much data or doing much compute". None of it is done during handling web requests unless you have no idea how to build systems.
1
u/SpeakCodeToMe Oct 14 '25
Okay, but not all services are just handling web requests.
1
u/FarkCookies Oct 14 '25
Bruh I am speaking about web requests, what point are you trying to make? That there are different kinds of workloads? Yeah, I am aware, hence the clarification. I don't think Nodejs is a generally a go-to tool for data-intensive tasks, so it is irrelevant.
1
u/Realjayvince Oct 14 '25
But that’s what I said.. it only matters when you system needs to scale for a large numbers of users and requests… 9 times out of 10… they don’t need that.. that’s why they choose node because the talent pool is cheaper and easier to find
Simple as that or everyone would choose a Java backend because it is better. But performance isn’t a question when you have under 200 users …
0
u/Dry_Hotel1100 Oct 15 '25
When it matters, neither Spring or Node should be the candidate. It might be a framework implemented with Go, Rust and also Swift since they are much lighter in terms of memory usage, and performance is also great.
1
u/SpeakCodeToMe Oct 15 '25 edited Oct 15 '25
I was part of a team that did a performance evaluation for a critical system that was going to be moving a large amount of data. (think millions of requests per second) We compared go, rust, and Java implementations.
Java won hands down, not because the code we wrote was more performant but because the libraries available with multiple decades' head start were much more performant, and because the jvm has similar advantages.
The "Java uses more memory" trope either comes from people who haven't used the language in over a decade, or people who look at memory utilization charts and don't understand that the jvm happily uses up all the memory you allocate to it before it starts GCing to improve performance.
There's a reason critical streaming tools like Kafka and flink are written in Java and databases are written in C/C++
1
u/Dry_Hotel1100 Oct 16 '25 edited Oct 16 '25
Can you explain why your observation is contrary to many benchmarks and comparisons.
For example https://www.youtube.com/@AntonPutra, https://www.techempower.com/benchmarks/or others, where Java generally comes out as the one using by far the most memory (10..50 times more than Rust), and has occasionally hiccups in performance, has low startup times, long shut down times, but as plus: CPU cycles average and performance is not that bad (not in the top, though) in uncontested usage scenarios (but falls short when stressed).
1
u/SpeakCodeToMe Oct 16 '25
I'm pretty sure I explained all of that in my previous comment.
You can write your own business logic to be faster in Rust or Go absolutely, but you can't drop in a library like Netty/Caffeine/etc. because they don't exist.
0
Oct 12 '25
[deleted]
2
u/SpeakCodeToMe Oct 12 '25
If you aspire to do something other than writing apis all day you will need more.
0
Oct 12 '25
[deleted]
2
u/SpeakCodeToMe Oct 12 '25
I mean this is a backend subreddit,
And I suppose you think back end engineering is just writing apis?
Stream processing, distributed systems, data engineering, embedded development... What are all of these fields to you?
are you sure you have worked in the field before? you give off student with big ego and no experience vibes, no offense
Pretty wild quote coming from someone who thinks back end means just apis. Career pro tip.. Branch out a little bit and you will make a lot more money.
where you attach your whole identity on one programming language
I've written code in almost 20 different languages during my career. Few as garbage as JavaScript.
0
Oct 12 '25
[deleted]
1
u/SpeakCodeToMe Oct 13 '25
You said "it's primarily API based" and then proceeded to condescendingly shit all over me.
how many people are writing streams (or need to) from scratch you think?
Hundreds of thousands? Anybody who works with large amounts of data?
totally unrelated fields - data engineering and embedded in there.
Because these people are backend buddy.
0
13
u/Guy-Without-A-Plan Oct 11 '25
Oh I’m team Java all the way, but I can think of reasons why people would choose Node.js:
Less boilerplate and faster setup. For smaller startups, you often don’t need all the OOB features that Spring provides. Node makes it easier to get something running quickly with minimal configuration.
Faster startup and smaller footprint. JVM-based apps can struggle with cold starts while NodeJS spins up fast, uses less memory, and doesn’t require a warm-up period (generally)
Same language for frontend and backend. If you’re doing SSR it’s convenient to keep everything in one language.
And while NodeJS doesn’t have true multithreading, it supports asynchronous I/O via its event loop architecture. That said, nothing really beats Java’s performance, scalability, and “battle readiness” once it’s up and running.
5
u/Prudent_Station_3912 Oct 11 '25
It might be useful if you could also describe advantages of using Java. I switched to Kotlin from Java and I don’t see myself going back to it ever again
4
u/Guy-Without-A-Plan Oct 12 '25
Java has a rich ecosystem and support and is a vastly mature language. If one is building systems that scale to millions, one often finds Java has a proven track record to do that. Most softwares like Kafka, Flink, Pinot, almost always have client libraries published in Java. Can’t say the same for Javascript.
As for Kotlin over Java? Anyday yes. Unless one wants sheer performance (in which case why not go with Rust or Go in the first place), would prefer Kotlin for sure. One gets the same rich ecosystem of Java but much better dev experience (no more null pointer exceptions, yay!)
2
u/Hirschdigga Oct 12 '25
Agreed, but your 2. point is solved these days by using GraalVM native image, and in my experience that works well
2
u/Guy-Without-A-Plan Oct 12 '25
Ooh we tried GraalVM at our org and yeah as you said, the cold start issues vanished almost completely. But for some reason our DataDog agent wasn’t able to scrape JVM metrics when we tried using GraalVM. Made us wonder if the support ecosystem around GraalVM isn’t as matured as it is around traditional JVM
1
2
u/Round_Head_6248 Oct 12 '25
In any non trivial project the business complexity is in the backend, so the whole spiel with „hey let’s use one language over our entire stack, it’s more flexible“ is nonsense. Frontend devs are usually shielded from the data and runtime complexity of mature projects, and getting them to dive into that is much more of a shock andhassle than simply learning a better language.
2
u/Resident-Hunt-245 Oct 12 '25
I completely agree and this is my experience as well. That's way I am asking because maybe I don't understand something
-2
u/Evening-Medicine3745 Oct 12 '25
Lol. Java is the biggest piece of dogshit I’ve ever seen.
1
1
u/Round_Head_6248 Oct 12 '25
I’m sorry for your disability.
1
u/Odd-General8554 Oct 12 '25
Me too.
-2
u/Evening-Medicine3745 Oct 12 '25
@Getter @Setter @Builder @AllArgsConstructor @NoArgsConstructor public class StupidUserEntityDTOMapperServiceFactoryBeanImpl {}
1
u/Evening-Medicine3745 Oct 12 '25
LOL, kk, I feel you. Not everyone can bear the weight of stupidity’s burn. But you, my friend, the chosen one, you can.
2
u/lalaland035 Oct 14 '25
Honestly, it's not about one being strictly better than the other. Node's non-blocking I/O model can be a game changer for certain applications, especially when dealing with lots of simultaneous requests. Java has its strengths too, particularly in enterprise environments. It just depends on the use case!
11
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
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
0
u/CreeDanWood Oct 12 '25
Sorry but ever heard of virtual threads? It's available since java 21 btw...
4
4
u/tluanga34 Oct 11 '25
Node has lighter development environment.
Faster to ship features
Speaks the web natively. Remember, JSON comes from Javascript.
Handle request more efficient than java.
Smaller ram usage.
Easiest to deploy
3
u/qqqqqx Oct 11 '25
I personally hate working with Spring even though I have to sometimes at my current job. It's a perfectly fine framework and can get the job done, has a package for most things you could think of... but the dev experience just kinda sucks imo. Feels very cumbersome to work with. Also easy for people to make a mess of things with too much abstraction or not understanding the internals.
The main advantage of node is that JS is already the only real front end choice. So using JS on the backend you can make certain things render either client side or server side without needing to translate. You can share more state or more resources (including brain share, since everyone can work with the same language). So that is probably why it is widely adopted. It also cold starts very fast compared to java so it gets used for cloud functions or other systems where it is advantageous to spin up and down instead of staying on all the time. Also node is very optimized for non blocking IO which is cool for certain applications.
Performance wise I think most people overthink performance. You can make node performant enough in 99% of cases, and if you can't you might need the interp with c++ or something similar to offload CPU heavy work. Otherwise performance is usually dominated by another bottleneck like database or network latency.
If you need lots of multithreading I like working with Go, it has some nice concurrency and is a nice language. But it has its own pros and cons.
At the end of the day any framework is basically fine and you can pick what you know best or enjoy best or learn what you need for your particular employer.
2
u/Beautiful-Hotel-3094 Oct 11 '25
Coz they just don’t need Java. Node is good enough so it is easier to write.
2
u/GetABrainPlz77 Oct 11 '25
JavaScript is still dominant. And it’s good enough for startup backend. They will pivot to Java or .net later
2
u/purefan Oct 11 '25
Most projects are CRUD systems, if heavy processing is needed you offload it from the main thread meaning you can build a part of the project in node and another in java or whatever you want.
Its not about choosing the most performant programming language, but choosing whats easiest to work with. If your engineers only know java then obviously java is the best option for your team
2
u/SuchBarnacle8549 Oct 12 '25
Because there a tons of crappy legacy java devs that cannot write good scalable code despite java being boilerplatey and structured. You can have amazing stuff like springboot but with shitty legacy devs they just don't use any of the features and mess up your entire system. For the record i think legacy .NET devs are probably better at design patterns and writing decent code
Its not that hard to make a TS / NodeJS codebase good given there arent many legacy devs in this aspect and even if there is, its much easier to refactor and AI is trained pretty well here. Just dont hire shitty vibe coders or juniors and youre good
Other factors like not needing heavy cpu workloads and node being scalable for async io tasks are considerations too
1
u/LazyMiB Oct 15 '25
Microservice architecture is popular. Node is convenient for writing them. And many projects just use s3.
1
1
u/1Kakihara1 Oct 15 '25
JS codebase is only good bc it never went that far to build a complex backend system that handles tons of users and soon as it gets there its legacy code is gonna be the shittiest among all, bc fullstack JS devs are all over the place and most of the time they never dealt with complex projects before..
1
u/SuchBarnacle8549 Oct 16 '25
it goes both ways tbh ... I worked in large enterprise microsystems with nodejs servers that scaled pretty well. And we also deal with concurrency, performance and even patterns to deal with rollbacks in async environment etc
of course i know you're referring to the vast group of online JS devs / vibe coders that probably never touched real projects outside of POCs- i guess its a comparison between them and legacy java devs with no passion in programming
1
u/re-thc Nov 06 '25
I've seen just as many bad NodeJs developers. I don't get the point. Java has a larger marketshare, so my sheer absolute numbers yes there will be more bad developers and codebases.
2
2
2
u/guywithknife Oct 14 '25
I use typescript and node because it lets me use the same language on frontend and backend (lowers my cognitive load, lets me share types and schemas) and has a large ecosystem. It has a good balance between convenience, performance, and ecosystem.
I’ve also extensively use Python, Java, Clojure and to a lesser extent C++, PHP, Javascirpt, Groovy
2
u/LazyMiB Oct 15 '25
Hey, Node has multithreading. How about worker_threads? You must use it if you don't want to block the main thread. Also, you can block the main thread in Java too if you don't use threads. A quote from docs:
Workers (threads) are useful for performing CPU-intensive JavaScript operations. They do not help much with I/O-intensive work. The Node.js built-in asynchronous I/O operations are more efficient than Workers can be.
V8 (js engine which Node use) has a JIT. Sometimes it faster than Java. See a benchmark. And uWebSockets is top 1 in techempower benchmark. The ultimate-express (rewrote Express 4) top 3.
I think Java is faster and more useful in some cases. But Node also doesn't slow. This comparison is very abstract. For example, the project may require specific API, SDK or libraries.
I think startups pick Node because JS / TS programmers more cheap. And this stack very convenient for fast prototyping. It's important factors, isn't it?
3
u/wrd83 Oct 11 '25
20 years of java xp here.
I think node is a good choice when picked wisely.
if you want to do ssr you don't do 2 different languages for rendering
if your team is full of front end engineers it's easier for team mates to transition.
For most workloads the need for java performance is not really there anyways.
2
u/DetectiveKaktus Oct 11 '25
Picking technology is not a straightforward decision and there's no right or wrong in selecting one language or framework or another.
Let's say there's a very trivial task like building a CRUD API or maybe a simple websocket server. Why would you bring the complexity and power of Java Spring to such a simple task? I'm not a fan of Java and so of JavaScript/TypeScript but if I would have to choose between these languages I'd pick JavaScript because it's simpler.
It all comes to using the right tools in the right situations.
2
2
u/valkon_gr Oct 11 '25
I was forced to work on nodejs backend projects for the last 1.5 year, and to answer your question: You don't. Never. There is no reason to do it, Java crashes whatever laughable thing the javascript stack is trying to do. I am actively interviewing to leave this stack and go back to my Java.
2
1
0
1
u/Tulipan12 Oct 11 '25
Lots of people pick up JS because of the web. Node can have an easier connection to the front-end and a wider talent pool because of it.
I'm not saying node is better, but the benefits are obvious.
You dont always need multi-threading and nest.js is far from the only framework.
1
u/sitabjaaa Oct 12 '25
Why should some one learn nest js ?
1
u/MrDilbert Oct 12 '25
NestJS is similar architecturally to Spring, and has a specific way of doing things, which may make it easier for different teams to pick up where previous teams left off. It reduces the cognitive load on the team that's onboarding and makes them productive faster.
1
u/shade_study_break Oct 11 '25
Typescript in both client and back end applications is really nice, especially if you are doing any SSR. Node in standard JavaScript is not ideal, but it might help teams where you can expect front end developers to be able to contribute or at least parse what might be going on in the API layer. In similarly practical terms, NPM, for all its flaws, is a better dependency management tool than gradle or maven IMO and the boilerplate code and project scaffolding of a Spring Boot app is quite verbose in comparison to Express. I don't think you can justify Node over Java in performance terms, but for a certain kind of team it likely allows them to move faster and adapt to their strengths.
1
Oct 11 '25
Because startup. Easy to hire (huge young talent pool due to barrier of entry) and less boilerplate. Most web based startup projects don't encounter a lot of CPU intensive requirements. For simple needs closer to FE or I/O bound then node is fine.
It's not the tools, but your usage and scale. Personally prefer strongly typed JVM based languages.
Once you see startups scale, they will start to encounter issues that come along with maintaining large node repos, dx or performance. Node is expensive to maintain and upgrade over years, and dx at scale is slow.
1
u/Ok-Sea-Try-3903 Oct 12 '25
!RemindMe 1day
1
u/RemindMeBot Oct 12 '25
I will be messaging you in 1 day on 2025-10-13 11:54:53 UTC to remind you of this link
CLICK THIS LINK to send a PM to also be reminded and to reduce spam.
Parent commenter can delete this message to hide from others.
Info Custom Your Reminders Feedback
1
1
1
u/Master_Wishboned Oct 12 '25
Maybe JS is the language of the web? Why learn two different languages for frontend and backend, when you can do both with one language.
1
u/JumpSmerf Oct 12 '25
I don't understand why you're asking about node.js over java in startups. Java is not the main language for startups at least since Ruby on Rails and Django started to be more popular. In 2010-20 these two and Laravel were the most popular for startups because that frameworks where you can create more when do less, this is more important for startups. In the last few years Node is more popular but Java has nothing in common here. Java is mostly a corporate language which is used by big companies and at the later time of the product live. You can find startups which were created in Java and Spring but it's not standard choice for most of the non corporate products.
1
Oct 12 '25
The question is. If you choose Java, one might as well use something else.
For the most part, one doesn't need multithreading. The async nature of JS gets around blocking, and the heavy loading isn't typically done in JS.
If one does require multithreading, then GO or something is preferable.
1
u/MASTER_OF_DUNK Oct 12 '25
That's such an interesting question for me, because I mostly work in the JS ecosystem, and I've never really considered choosing Java over node, even though I'm fully aware it's a very capable and powerful language. My understanding is that Java is really object oriented, whereas JS is multi-paradigm. So if you come from a JS background, using Java would be like sacrificing familiarity and flexibility for dogmatism and performance. But in terms of performance, Rust and Go are more appealing. That being said, the JS ecosystem suffers from its flexibility : people constantly create new frameworks and bring ideas from different languages in, which can make working with Node exhausting. It's interesting that you point out NestJS, because it was clearly made to appeal to Java devs, and most JavaScript devs find it un-appealing, despite the fact that it's a pretty good framework.
1
1
u/wbrd Oct 13 '25
They're for different things. Node is good at sitting at the edge and serving traffic. It should be doing as little business logic as possible. It's easy to spin up and write for people who don't normally write backend software. Java requires a bit more to start up, but it's also a lot more capable and should be where you write the business logic that Node calls into.
One caveat, in Node it's popular to use latest as the version for dependencies. This is wrong and only appropriate if you 100% control the dependency. The practice is a pox and has infected other languages.
1
u/No_Walk_3786 Oct 14 '25
Because you don't have to write 100 lines of boiler plate code to just print a text on screen
1
u/FooBarBazQux123 Oct 14 '25
Node has the advantage of using a single language for both front end and backend, plus it is serverless and asynchronous friendly.
I would still chose Java over Node for enterprise backend though. JavaScript has no multithreading, buggy math, instabile libraries, etc.
1
u/random_stocktrader Oct 14 '25
Fast enough to run. Vast talent pool. In the worse case scenarios we can just scale it out horizontally.
1
u/colorado_spring Oct 14 '25
The decision was made during the height of the Node.js hype. The company I work for now has a 10-year-old Node.js codebase with over 600,000 lines of code. They regret it, but keep adding more code because it’s convenient and the cloud costs are manageable. Now, with AI, things have gotten even worse as no one cares about which language is powering the engine anymore.
1
u/Boring-Test5522 Oct 15 '25
small team needs something on the market NOW. When their product can grown 1000000 DAU then they can reengineering the whole stack later.
Nevertheless javascript is perfect for vibe coding.
1
u/_inf3rno Nov 04 '25
No strong typing, simple script language. There is multithreading with workers.
1
1
Oct 11 '25
crazy you guys are talking about performance before the fact that node is JavaScript…………….
awful to write and refactor
6
u/Prodigle Oct 11 '25
Everyone uses TS nowadays, which has genuinely an industry-leading type system
2
Oct 11 '25
That’s kinda true and kinda hilarious depending on where you’re coming from. TypeScript’s type system is great for expressiveness and developer experience. You can model absurdly complex objects, infer shapes from data, and your IDE feels like magic. It’s amazing for front-end or API work. But from a systems or backend perspective (Go, Java, Rust, etc.), it’s smoke and mirrors. TypeScript is unsound by design. The types disappear at runtime, the compiler lets a lot slide, and it all runs on a single-threaded JS engine anyway. So when a TS dev says “industry-leading type system,” a Go or Java dev hears: “I write compile-time fanfic for a runtime that doesn’t care.” Different cultures, different goals. TS is “move fast with types that help you think.” Go and Java are “move carefully with types that actually matter.”
1
u/Prodigle Oct 11 '25
The strength I think it has that is undervalued is:
Yes, if you wanna model a really complex and tight interface, it's fantastic. Part of why Node's ecosystem is so nice to use is that the type-system of TS is used heavily by libs, and a bulletproof interface being defined by a typing system is absoluely magical if you're working with a lot of libs
Doing something less important or that doesn't need to be as robust? dump it. Use as little or as much of the typing as you want
I should mention, I'm not just a TS dev. Most of my work has been in C# and recently Go, and I'll still go to bat for TS being amazing. I wish it could use it everywhere. Nothing feels worse than needing to define some complex typing & interface in a statically typed language just to load/save some JSON.
Yes the runtime underneath doesn't care, but that causes problems less than you'd think, and again, the single-thread doesn't really matter if the majority of what you're doing is IO bound
1
u/BothWaysItGoes Oct 12 '25
Java type system is infamously unsound by design. Wrong variance of arrays and no null protection.
0
u/Hey-buuuddy Oct 11 '25 edited Oct 12 '25
You have 15 years of professional experience and can’t itemize the differences between Java and JavaScript?
Let’s back up a bit… JavaScript (and any library published made out of JavaScript) was intended to interact between html DOM and CSS in a web browser- that’s it. Thank you Brendan Eich. When web sites started to mature and asynchronous http operations were hypothesized, JavaScript was facilitated that it what was know as Ajax. Then around 2008-2010, jQuery was published to fill functionality gaps that native JavaScript did not have. But it was all just JavaScript. Then everyone and their grandmother started making libraries, then in the worst possible climax, people started running JavaScript on servers (grunt, etc).
Java is a high-level, object-oriented programming language designed to be platform-independent through its “write once, run anywhere” capability using the Java Virtual Machine (JVM). It compiles to binaries that can be executed just about anywhere, as where JavaScript uses a web browser for compilation at runtime (Just-In-Time JIT compiler).
For scripting purposes on servers, sure- I suppose you could use JavaScript but there’s usually more powerful native scripting languages available. Java requires SDLC and alm to be effective, as where junky scripts do not necessarily.
0
u/Fun-Helicopter-2257 Oct 11 '25
With Java you will have job for sure.
With Node you can make frontends as well, and maybe got job.
I toyed with Rust a little and it is x100 more comfortable to build server side than node, same time Java jobs always there. Node - was a thing N years ago but now I see more Java jobs AGAIN.
0
u/neopointer Oct 11 '25
Some good reasons:
You want to pay less
You don't care about quality
You didn't care about supply chain attacks
-1
-1
u/Icy_Physics51 Oct 12 '25
Dunno, bad idea. Rust > Go > Java > Bun > Python
3
2
u/Evening-Medicine3745 Oct 12 '25
I use Rust and Node.js daily. Node.js is excellent for I/O, and I support two large financial microservices written in Rust. Damn, I can write a microservice in Node.js with just 50 lines of code and no dependencies. Rust and Node.js make the best combination.
1
u/Lanareth1994 Oct 12 '25
Where (or how) did you learn Rust? Kinda interested by it but I didn't find non confusing ressources about it yet
2
u/Icy_Physics51 Oct 12 '25
Generate Rust code in AI chatbot and ask it to explain every line.
1
1
u/Evening-Medicine3745 Oct 12 '25
This is a harmful way to learn Rust. Maybe with some experience (walkthrough official learning resources are required minimum)
1
u/Icy_Physics51 Oct 12 '25
Best way to learn just about anything. Not only tech related.
1
u/Evening-Medicine3745 Oct 13 '25
I disagree. LLMs make a lot of mistakes. If it works for you, good. But I think you learn little or nothing because, by using it, you skip the learning process. I think that with LLMs, it’s impossible to build a solid mental framework for a subject.
1
u/Icy_Physics51 Oct 13 '25
You learn the most when you're having fun or while doing something you know will be useful. Actuall writing code is much more fun than studying fundamentals from docs, blogs and videos. There could be some mistakes from AI, true, but it is marginal, and only noticible while doing something unusual.
1
u/Evening-Medicine3745 Oct 12 '25
I'm going through a Rust book with official examples, reimplementing some CLRS algos and data structures in Rust (stuff I originally wrote in C back in uni), and reading Zero to Production in Rust. Doing all that in between other things, been messing around with Rust since 2016. My second love after Haskell (:
0
Oct 12 '25
[deleted]
3
u/SeatWild1818 Oct 12 '25
IIRC, Node was created for the non-blocking IO. that's what Ryan Dahl said when he introduced the runtime. The fact that frontend people can write servers wasn't even mentioned
2
u/notoriousrogerpink Oct 13 '25
The JavaScript ecosystem is a bit weird to put it mildly in that there are huge huge numbers of people in it who have zero interest at all in learning anything else. I hadn’t really seen that elsewhere in over 30 years and I say that as someone who’s been doing web stuff the entire time.
1
u/Intelligent_Part101 Oct 12 '25
Context switching between 2 completely different architectures is not a small thing. For "full stack" developers that on a constant basis have to work on front and back end, it's helpful to have the same basic platform for both ends. Remember, the language is only part of the platform, all the tools and frameworks that go along with the language must be learned too.
0
Oct 12 '25
[deleted]
1
u/Intelligent_Part101 Oct 12 '25
I think our terms are confusing the issue. Let me try a different term: it's preferable to have similar "stacks" for front and back end in that this reduces context switches for the full stack developer. I define a "stack" as a programming language plus all its tooling. In the case of front end and back end having DIFFERENT programming languages, the front and back end stacks will likely be totally different. If the front end and back end programming language is the same, then the front end and back end stacks can share much of the same tooling. Same build system (or at least much of it the same, say, npm for JS), same unit testing framework, similar debugging techniques. Front end source code can be moved directly to the back end or vice versa should it prove necessary. The advantage to all this is developer experience due to reduced friction. The disadvantage, if there is one, might be from not choosing a back end technology that would have better performance.
5
Oct 12 '25
[removed] — view removed comment
1
u/MrDilbert Oct 12 '25
it is multithreaded
This is a bit of a loaded term... Node itself is multithreaded, but its main process (JS interpreter) isn't. So, it's possible to make it as slow as molasses if it's used for a lot of calculation-heavy processing on the main thread, but it's also possible to offload this processing to other threads and processes. Which is what Node does OotB with I/O and networking stuff.
5
u/pokatomnik Oct 11 '25
Java has no syntax sugar, but node+typescript has. Multithreading can be done with web workers, but is needed only when you write cpu-bound code (which is a rare case for microservices). In addition to that, Typescript is much simpler and has no boilerplate. Try to compare node with Kotlin instead.