Java Developer

How Hibernate Almost Ruined My Career

Imagine that you are a Java developer, and you’re about to start your next big project. You need to make the fundamental decisions that will stick with you for the rest of the project. You want to pick the best object-oriented abstraction of your flexible data model because you do not want to deal with plain SQL. You want to support all kinds of data, and ideally, support all sorts of databases.

The obvious answer is to just use Hibernate, right? 90% of Java developers would agree with you, but does that make it the right decision?

Let’s take a look at what can go wrong if you blindly use Hibernate just because it’s the accepted standard.

Consider Monica, a Java developer. Monica has recently been promoted to the role of architect and is now responsible for laying out the technology stack for a new product at her company. She knows that in the Java world there is only one good tool for handling database communication: Hibernate. Hibernate is a well known and supported JPA standard. However, it is always a good idea to check a few things before starting a project. Fortunately, her colleague, Ben, knows the right guy.

4 Years Ago, Hibernate Sounds Like A Silver Bullet

3 Years Ago, Growing Pains With Non-Flexible Solutions

2 Years Ago, We’re Now Hacking Together Solutions In SQL Again

2 Weeks Ago, Giving Up On Hibernate

Today, So What’s The Lesson Learned?

Wrap Up

Monica is a Hibernate expert. However, Hibernate in this instance was a wrong decision. The moment she discovered that her solution turned into a bigger problem than the original, it was the largest threat to the whole project.

Data is the central purpose of the application and, like it or not, affects the entire architecture. As we learned from the story, do not use Hibernate just because your Java application is using a database or because of social proof. Pick a solution that embraces flexibility. There are plenty of options for robust JDBC wrappers, such as JdbcTemplate or Fluent JDBC Wrapper. Alternatively, there are other powerful solutions, such as jOOQ.

See what people say about this article on the Toptal or Reddit page.


Like it? Share it on , , ,

About the author

Grzegorz Gajos, Software Architect with international consulting and programming background. Co-founder of Open Tangerine Software House. Quality evangelist. An experienced entrepreneur, out of the box thinker and problem solver.

Newer >>