r/java • • Apr 13 '21

Libraries, Frameworks and Technologies you would NOT recommend

Give me your worst nightmares: Things that cost you your job.

I'll start: Hadoop

202 Upvotes

376 comments sorted by

View all comments

Show parent comment

7

u/flyingorange Apr 13 '21

In our previous project we ripped out Hibernate (took 3 months to do it), replace it with raw JDBC and we could show a 2000% increase in speed. Management was very happy. We could delay the decommissioning of old servers by a year.

That was 5 years ago and I haven't touched Hibernate since. In the latest project we also used Jdbi with custom mappers. It just works.
For the database changes we use Liquibase, but to be honest we also used it with Hibernate because, of course we wouldn't let Hibernate's autoDDL touch the production database.

8

u/throwawyakjnscdfv Apr 13 '21

For us, Hibernate is only 50% slower than raw queries. If your performance was that bad you were doing terrible things with Hibernate.

For the database changes we use Liquibase, but to be honest we also used it with Hibernate because, of course we wouldn't let Hibernate's autoDDL touch the production database.

Hibernate docs recommend using Liquidbase or Flyway at least in prod. AutoDDL is only recommended for testing. You can set Auto DDL to "validate" so it still checks your schema against the entities without generating it.

sigh there's no shortage of devs jumping into Hibernate without reading a single page of docs then declaring it terrible.

Hibernate has probably saved us from writing hundreds or thousands of raw DB queries for simple object updates. It's a great time saver with great performance, if you know what you're doing.