Skip to main content

Database Optimization

Learn Database Optimization (Performance Optimization, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes Biggest cost : in most MVC apps the database is the slowest part, so tune queries before tuning Java code. N+1 problem : loading a list and then one query per row; fix it with JOIN FETCH or @EntityGraph . Connection pool : Spring Boot uses HikariCP; size it so threads do not wait or overload the database.

More lessons in Performance Optimization