Performance tuning in Spring Boot is mostly about the database boundary: connection pooling, caching, and killing the N+1 query problem. Measure first (Micrometer + Actuator metrics), then attack the biggest cost.
The N+1 problem — the number one JPA killer
Lazy associations issue one query per parent, then one more per child access:
List<Order> orders = orderRepo.findAll(); // 1 query
(Order o : orders) {
o.getItems().size();
}
