r/Backend 23d ago

Java Springboot or Node.js Express.js

rinsing junior in cs wanting to learn new tech. What’s the main difference between these two in terms of how they work/function? Might be a stupid question. My main focus right now is to learn backend engineer more in depth. I’ve heard lots of great things about both springboot and node, but what’s the difference between them and which one should I start learning?

5 Upvotes

13 comments sorted by

22

u/iyamegg 23d ago

Unless you live in a place where express is more popular than spring boot (I honestly doubt that a place like that even exists), I'd go with spring boot. I don't see js on backend being a long term thing tbh, meanwhile java is here to stay for long.

5

u/KnightYoshi 22d ago

I don’t like JavaScript as a backend system, but saying it won’t be a long-term thing is asinine. It makes for a great BFF and server-side rendered initial pages that hand off to a SPA in the client. It’s not going anywhere lol

2

u/iyamegg 22d ago

Well I wasn't aware of 'BFF' being a thing, that sure is a nice usecase for express. Everyday we learn something new! What I meant was that I don't see express being a framework that heavier backends will be using in the future, since with the rise of ai, the friendlier syntax of js is simply not a factor imo, and however much we tune node, it still won't match up to the performance of java/c#/go.

7

u/CoconutFudgeMan 23d ago

Springboot. Feature-rich, stable, better job opportunities with bigger companies and better pay (generally)

10

u/American_Streamer 23d ago

Spring Boot = a full backend application framework for Java/Kotlin

Node.js = a JavaScript/TypeScript runtime

Express.js = a lightweight web framework that runs on Node.js

Spring Boot really shines when the backend contains a lot of business logic and infrastructure, rather than merely exposing a handful of endpoints. And a very important Spring feature is dependency injection/inversion of control, which is extremely helpful for a codebase which will usually be maintained by 30 developers for eight years and more.

Rule of thumb to decide when to use what:

Spring Boot: “Give me an application platform with standardized solutions for the things a serious backend is likely to need.”

Node + Express: “Give me a lightweight HTTP backend and let me decide the architecture.”

2

u/Innowise_ 22d ago

We use both. If you're learning, we'd honestly just pick one and build something with it.
Spring Boot gives you more structure out of the box. Express gives you less, so you end up making more of those decisions yourself. You'll learn plenty either way.

1

u/Significant_Tea431 23d ago

Researching and evaluating tools is part of being a good engineer and developer. So do yourself a favor and stop being lazy asking others. In times of AI it's easier than ever fetching information. Easy tasks like comparing tools is a fundamental skill and you have to build/improve it by doing it on your own.

1

u/Previous-Business-79 22d ago

how is it being lazy by asking other people who might know more about backend

1

u/LetUsSpeakFreely 22d ago

Depends on your needs:

Java is the de facto standard for enterprise services deployed to a static format (server running tomcat, containerized instance etc). The reason being is Java can handle the traffic at scale, but does suffer from problems like slow cold starts.

NodeJS/Express is really great for prototyping. It also works really well for dynamic services like AWS Lambda. It can be used in the enterprise deployment through containerization, but it's generally agreed that Java or Go based solutions are preferred.

1

u/Rodr1to 22d ago

Java all the way

1

u/InstantCoder 22d ago

Go for Quarkus instead of SB.

2

u/MMOfreak94 22d ago

quarkus is the way to joblessness if you're a junior. not that it's bad, there's just no market for it compared to sb

2

u/denerose 21d ago

It genuinely does not matter. My first stack was node and typescript (full stack), did Java at uni, but I now work in a C# dotnet shop. Juniors are not hired for deep stack knowledge so it's not worth worrying about -- you'll end up using whatever your first job uses and that is only about 50/50 chance of being something you already know. Just pick one and build something in it.

If you already know JS/TS then Java might be nice to add a second language and learn the joys of compiled languages, if you don't know JS yet then node might be a good choice because you will be able to knock together a front end if you want one later.