Spring Boot में performance tuning ज़्यादातर database boundary के बारे में है: connection pooling, caching, और N+1 query समस्या को खत्म करना। पहले माप करें (Micrometer + Actuator metrics), फिर सबसे बड़ी लागत पर हमला करें।
N+1 समस्या — सबसे बड़ा JPA killer
Lazy associations प्रति parent एक query issue करती हैं, फिर प्रति child access एक और:
List<Order> orders = orderRepo.findAll();
(Order o : orders) {
o.getItems().size();
}
