Post-launch ORM-based model optimization

I use Hibernate to work on a new project, and while working, I understand that my initial vision of the application cannot become his fate. Data, which I think will not be frequently requested (and therefore, it will be loaded lazy), may be necessary for 85% of requests. Conversely, the data that I download under the assumption that this will be necessary may not be required as often as I think.

Is there any profiling tool or method for analyzing the use of ORM (in particular: Hibernate) that can help me set up my application after it reaches a critical mass?

The only thing that comes to mind is to write several Selenium scripts that simulate actual use and perform load testing with various configurations. It seems like this might work, but also seems like a very round way to get the information I receive. There must be a better way ...

+6
performance optimization hibernate
source share
4 answers

Is there any tool or method for profiling the analysis of the use of ORM (in particular: Hibernate) that can help me tune mine after it has reached a critical mass?

Hibernate 3 collects statistics at runtime. Maybe worth a look. There is a Performance Monitoring section in the hibernation document.

The only thing that comes to mind is to write some selenium scripts that simulate actual use and perform load testing with configurations. It looks like it might work, but also a very round way of getting the information I get.

You must first try to capture the real workload. Then figure out how to play it.

Otherwise, you will still be biased and can generate a load that does not actually represent reality. If you cannot capture the real workload, then discuss with the potential end-user how they use the application and make sure that your scenario is as close as possible to the real user behavior.

+1
source share

"... help me tune my application after it reaches a critical mass?"

It is important.

You are customizing your application - in general. App database structure + Hibernate ORM mappings + something else.

Your application must have logs that you can use to configure your application. If you do not have a suitable log, it is time to add the appropriate set of logs to determine which use cases are being used and what is happening.

Setup logs are just as important as debug logs. And this is the first-class part of your application.

+1
source share

Hibernate Profiler can generate direct reports from hibernation statistics. Various warnings are generated, such as a SELECT N + 1 warning.

It can be used in a continuous integration system.

+1
source share

Use the SQL profiler / logger of your database to save the tabs of your production database. Watch for lazy downloads or frequently repeated requests that may indicate a N + 1 problem (iterating over a lazy collection, loading each object individually).

I do not know about (any) ORM that provides such an opportunity.

0
source share

All Articles