r/Backend • u/Sad_Importance_1585 • 4d ago
Java 25 (with virtual threads) for a startup
Are you working in a startup company that chose Java 25 as a backend language?
What is your impression regarding developer experience, performance and easiness build things fast?
9
u/Sea-Offer88 4d ago
I am working on my own webshop and went with java as it is more stable than the nodejs counterparts that said I have also Nestjs projects and worked on Asp. Net. Projects too.
The nice part is that Java Spring has been around for a very long time and many of the needs that you will need have been addressed and most of the time you add a module and some configuration. Since I have both java and nestjs projects I would say development speed is similar, but java has more stable modules out of the box and the standard ones are also top notch and battle tested, whereas with node you assemble what you need (e.g. Orm Prisma, drizzle...)
Example in node that is annoying is that I liked prisma and used it a lot, but soon v8 will be released which means on a huge project I will have to do a lot of changes because they decided to rewrite it and comes with breaking changes, and that is a lot of work.
In java I just used flywheel and added the sql but the entities still remain the same.
Concepts are similar in spring boot, nestjs, Asp.net and the tipical solutions usually are controller, service, repository, although each of them reinforces the structure their own way. Structure is nice once the app starts to grow.
My webshop will be deployed using docker and probably only 1 replica at the beginning unless there is more demand.
So Java Spring Boot with java 25 is a solid choice.
6
u/anurodhp 4d ago
Java is a great choice with a good ecosystem and a lot of developers who know it. Spring / spring boot will save you a lot of time.
6
u/za3faran_tea 4d ago
We're running several backend services in Java. Some consume from Pub/Sub, others from Flink, and others are REST services. We're always on the latest release, we update within a couple of weeks (we're bound by Gradle support of the latest JDK, which usually comes out in a few weeks).
They have been some of the most reliable services we have (particularly compared to... python, sigh). Mature libraries and ecosystem. Uptime and performance are fantastic.
5
u/VegGrower2001 4d ago
I'm using Java 27. It's fantastic, and most of what's fantastic about it is in 25.
11
u/macabre_brotherhood 4d ago
The following are good times to NOT use Java:
* GUI / desktop apps
* Short-lived processes where startup latencies matter, like CLIs or Lambda functions
* Memory restricted environments where you require tight control over allocation
* Real-time applications where a garbage collector would negatively impact timing
* Unresolved trauma from the classloader or generic type erasure implementation
If none of those apply to you and your team, it's a perfectly cromulent language. Widely used, widely trusted, blah blah blah. Very mature. Hard to go wrong.
11
u/woj-tek 4d ago
GUI / desktop apps
Hmm... while it's somewhat true that "Java lost the desktop" I'd argue you could create quite nice desktop/GUI apps with either Swing or JavaFX (heck, IntelliJ is written in Java!) or even use Qt bridge (Jambi: https://wiki.qt.io/Qt_Jambi). The result wouldn't be all that much "heavier" than electron 💩 we are forced to use nowadays...
5
u/starbuxman 4d ago
Javafx + Spring Boot + GraalVm is pretty amazing
It’s infinitely more performant than electron
And you can trust the type system, which is nice
1
u/lazystone 4d ago
I did some prototyping with Avaje Inject and JavaFX and it works.
Avaje Inject is compile time weaving and very lightweight(especially comparing to SB), so startup time is minimal.
0
u/macabre_brotherhood 4d ago
True, I've seen good UIs. Let me put it this way, as a user, I can usually tell when it's Java. It lags in weird ways. It's clunky. The memory usage is pretty rough. And so for me, I look for more native experiences - at least when there's feature parity. If the only thing out there is a Java desktop app, and it does something uniquely useful, I'll use it.
1
u/th3_pund1t 4d ago
It lags in weird ways. It's clunky.
Typically, this is a result of someone performing IO or heavy compute in the render thread.
You can have the same problem in many other UI frameworks.
Bad UIs are not unique to Java Desktop. I've seen bad UIs with iOS, Android, Electron, etc.
2
u/macabre_brotherhood 4d ago
Could be that, but it also could be the JIT compiler cold-loading some hitherto-unused section of the code. Could be the GC. Could be the developer being bad at shared state. Could be a lot of things. And the effort involved in finding out the answer to that question, is juuust high enough, that many Java devs will simply not do this portion, and call the lags "good enough"
1
u/woj-tek 3d ago
Hmm... Don't have that much experience with Java desktop apps (dying bread) so can't compare that well. And comparing to IDEA is problematic because it's gigantic...
Alas, I do agree with some issues: other solutions have more "native" integrations (with the rest of the system like tray or dock) and are generally better at "faking" looking native-ish. It's a result of years of huge neglect while the rest of the gang sprinted past java…
10
u/za3faran_tea 4d ago edited 4d ago
Real-time applications where a garbage collector would negatively impact timing
Unless its hard real-time, you may very well be able to use ZGC as it gives you sub-ms pause times. Even then, Java has been used for real time systems before ZGC (but it generally uses a different paradigm of programming than traditional backend systems).
3
1
u/macabre_brotherhood 4d ago
Yeah I mean "each clock cycle matters" level of real-time. All I'm saying is use the right tool for the job. But yes you're also right about ZGC.
1
u/aoeudhtns 3d ago
I'm using generational ZGC for a near-realtime service and it's working exceptionally well.
0
3
1
1
3
u/definitelyoneof 4d ago edited 4d ago
The moment you look past internet memes is the moment you realize Java is actually amazing at delivering value instead of keeping you locked in useless churn. The available tooling is leaps and bounds above the average too.
1
u/clhodapp 4d ago
The rise of LLMs has made every language easier for developers to work with, and faster to deliver with. Java is no exception. On the other hand, it has definitely polished away things that might have been deal-breakers on Java's competitors too. For example: Rust has become practical in a LOT more scenarios than it made sense for previously. In the end, Node, Java, Kotlin, Python, Rust, C#, and Go probably all generally make sense on the backend at this point. And you can even probably make things work with Scala, Ruby, C++, or Haskell if you really wanted to.
3
u/za3faran_tea 4d ago
LLMs do make things easier, but I still find the better and more strict the tooling around available in your dev stack, the better it would make the code LLMs generate.
Making unsupported states impossible to represent goes a long way. Languages with sealed types and pattern matching (Rust, Java, and now C# in their latest release [but not yet fully fledged it seems]) have that; golang does not. It seems the runtime will become more and more important as we generate more and more code, and the JVM has a big edge here compared to others: strong optimizations, state of the art GCs, continuous profiling, etc.
1
u/clhodapp 4d ago
That is a totally fair view. Move Go to the "can even probably make things work" pile (even though some of the languages I put there have great support for disjunctions).
1
u/knowyourclass 4d ago
java is so boring with all the legacy and null checks, might as well pick kotlin
1
u/joemwangi 3d ago
Always wanted java to get null-restricted types sooner. I wonder what arguments will be then.
1
u/glandis_bulbus 2d ago
Spring is using JSpecify - works great
1
u/joemwangi 2d ago
But the creator of JSpecify and java team are planning to introduce null-restricted types in java.
1
1
u/MaintenanceSmart1265 3d ago
java=> developer experience great , java=> performance good ,java=>build things fast? not really
1
u/spudtheimpaler 2d ago
Can recommend spring modulith if you go with java and spring - enforces good architecture with tests which greatly helps you and agents when bootstrapping
1
u/LotusFloewr 1d ago
I would honestly pick java for project of any size nowdays. First thing to mention it is crazy good with llm I recently switched to go and it’s nowhere close to code written in java by agents. Second thing is crazy amount of highly optimised libraries for literally anything you need. Next thing is performance you can code like shit and your app will still be faster than majority of the languages because of jit and many performance improvements done in recent years.
0
u/Defiant_Squirrel8751 2d ago
2026 and AI means: programming language does not matter anymore. It is irrelevant. Focus on features, business logic, software architecture and product quality.
You can always write Claude a prompt like "generate code for this using Rust" or java 25 or whatever. Nobody cares.
1
u/arabian-tea 2d ago
The tooling, libraries, documentation, runtime capability matter more than the syntax. The JVM has a strong advantage here.
23
u/UnderdogRP 4d ago
It works very well. High performance. But use a framework like micronaut or quarkus. AI is very good at java since there is so much open source project sin java that it has been trained on.