Live data from Hacker News

Problems with JPA/Hibernate

stemlaur.com

11–20 of 195 posts

Re: Problems with JPA/Hibernate

#11
post #8

The underlying problem is one of O-R impedance mismatch. Going full SQL and getting rid of the ORM is a possible answer, but it has tradeoffs and is not a silver bullet. It might mean re-creating from scratch an in-house, bug-ridden ORM, or ditching OOP idioms from your language, or both. The author of TFA seems to be going through one of the stages described in "ORM is the Vietnam of Computer Science", an article th…

Here's the article

http://blogs.tedneward.com/post/the-vietnam-of-computer-scie...

Edit: huh, seems to have got truncated over the years. Here's an archive link

https://web.archive.org/web/20160120004603/https://blogs.ted...

Re: Problems with JPA/Hibernate

#12

What is the argument in favor of server-side Java in 2021? It seems like alternatives like Go, Python, or even JS are far ahead at this point

Java has support for the schema definitions that I need, the other languages you list don't. I am happily using JPA/Hibernate too.

Re: Problems with JPA/Hibernate

#13
post #4

Earlier quoted context omitted.

Far ahead in what sense? In my previous job we used Java and the benefits were a huge ecosystem of libs and tools, plenty of monitoring tools, a ton of expertise and people who understood its memory model and quirks and were able to troubleshoot production problems. The JVM is rock solid and has great performance for backend with lots of transactions. I'm not experienced with Go, Python doesn't seem particularly suit…

The JVM is rock solid, and recent improvements in garbage collection have reduced tail latencies dramatically. But I find that most people who say that it has "great performance" have not built a parallel implementation in JS, Go, Rust, or even .NET Core. I'm omitting memory unsafe languages by default and Python here, because I think that's the domain Java competes in, and Python lacks the investment these other lan…

TechEmpower Web Framework Benchmarks would like to disagree with you.

Re: Problems with JPA/Hibernate

#14

What is the argument in favor of server-side Java in 2021? It seems like alternatives like Go, Python, or even JS are far ahead at this point

What is the best argument against it? And the whole JVM platform in general (Kotlin, Scala, Clojure...)

Re: Problems with JPA/Hibernate

#15
post #9

From my experience ORMs are good time savers when you have relatively simple query needs, but fall down when things get really complex.

"Really complex" means getting down to 6 or 7 joins for your typical SQLAlchemy or Django ORM query. These sorts of queries comprise 5% of my queries, tops.

Seems like a fair tradeoff.

Re: Problems with JPA/Hibernate

#16
post #14

What is the argument in favor of server-side Java in 2021? It seems like alternatives like Go, Python, or even JS are far ahead at this point

What is the best argument against it? And the whole JVM platform in general (Kotlin, Scala, Clojure...)

I can’t speak for others, but scala’s has two of the best sql db libs I ever used, namely doobie and quill. https://github.com/getquill/quill https://tpolecat.github.io/doobie/

Re: Problems with JPA/Hibernate

#17
post #13

Earlier quoted context omitted.

The JVM is rock solid, and recent improvements in garbage collection have reduced tail latencies dramatically. But I find that most people who say that it has "great performance" have not built a parallel implementation in JS, Go, Rust, or even .NET Core. I'm omitting memory unsafe languages by default and Python here, because I think that's the domain Java competes in, and Python lacks the investment these other lan…

TechEmpower Web Framework Benchmarks would like to disagree with you.

I don't think those are particularly realistic workloads, as they don't involve substantial amounts of working with in-memory data. Which of the TechEmpower benchmarks uses an ORM?

Before I finished drafting my comment I did have a sentence like this, which I removed, "Barring obscene amounts of optimization", so yes, some web servers like netty and jetty have gotten to a level of good performance in terms of handling plain requests.

But most line of business backends are not using plain jetty/netty, they aren't just responding to every request with the same "SELECT" query to a backend database. They're doing computation, they're storing intermediate data in data classes like ArrayList, TreeMap, etc.

And then of course due to business requirements, they often have to implement some in-process caching, and suddenly the lightweight Java application is a bloated multi-gigabyte CPU consuming monster.

I just don't see that happening often with more memory and cache friendly languages like Go, Rust, Swift, or even JavaScript on V8/Node.js.

Re: Problems with JPA/Hibernate

#19
post #3

What is the argument in favor of server-side Java in 2021? It seems like alternatives like Go, Python, or even JS are far ahead at this point

A huge developer base and eco system? What specifically, can't be achieved in Java, that you think node is needed for?

Rendering Javascript.

Re: Problems with JPA/Hibernate

#20
post #4

Earlier quoted context omitted.

Far ahead in what sense? In my previous job we used Java and the benefits were a huge ecosystem of libs and tools, plenty of monitoring tools, a ton of expertise and people who understood its memory model and quirks and were able to troubleshoot production problems. The JVM is rock solid and has great performance for backend with lots of transactions. I'm not experienced with Go, Python doesn't seem particularly suit…

One benefit I've been seeing with server side JS is from FAAS like Lamba which can serve unpredictable loads very inexpensively.

How is that a benefit specific to JS? Don't those platforms generally support Java as well?
Post reply on HN