When to use Hibernate?

I was asked in an interview with this question, and I answered as follows:

-Will be performance: - Effective requests. - caching of the 1st and 2nd levels. - Good caching gives better scalability. - Good database portability: - Changing the database is as simple as changing the dialect configuration. - Increased developer productivity: - Think only about object terms, not language query terms.

But I also feel that the systems fall into one of the following categories, and Hibernate may not be suitable for all these cases, I'm interested in your thoughts on this, do you agree with me? tell me when will use HB in the following case and why.

  • Recording systems only:
  • Only for reading:
  • Write mainly systems:
  • Read mainly systems:

Relations Rameau

+4
source share
1 answer

Hibernate is suitable for most applications where you have an object-oriented model . Therefore, you may ask: is an object-oriented model suitable?

I would say the biggest advantage is developer productivity. Query performance itself is usually worse than manual-encoded queries, because it cannot be optimized for each specific case. Sleep mode very well compensates for the use of caches.

Only for writing (and mostly) systems can not take many advantages from caches, it can even significantly reduce performance (you should avoid using the cache). Such systems usually do not need an object-oriented model; they simply insert data into the database.

+1
source

Source: https://habr.com/ru/post/1312161/


All Articles