Articles
Spring articles
Free, practical articles on Java, Spring, SQL and AI for backend developers.
-
Spring Boot rate limit by IP behind Cloudflare
Rate limit by IP in Spring Boot behind Cloudflare: read CF-Connecting-IP only from trusted proxies, key IPv6 on a /64 and answer 429 with Retry-After.
-
Modular monolith vs microservices: start with modules
Why a modular monolith is the safer default than microservices, and how to enforce module boundaries in Spring Boot with Spring Modulith and ArchUnit.
-
Spring AI structured output: call an LLM from Java
Get a typed Java record from an LLM with Spring AI ChatClient and .entity(). The schema it sends, native mode, failure cases and tests on Spring AI 2.1.
-
Java virtual threads: when to use them and when not
Virtual threads pay off for many tasks that block on I/O and do nothing for CPU-bound work. Pinning, pooling, ThreadLocal and Spring Boot, with measurements.
-
JPA N+1 problem: three ways to fix it in Hibernate
What the N+1 query problem is in JPA and Hibernate, why EAGER does not fix it, and how JOIN FETCH, @EntityGraph and batch fetching compare, with SQL counts.
-
Spring Boot 4 migration: what changes from Boot 3
What breaks when you migrate Spring Boot 3 to 4: modular starters, Jackson 3, removed test annotations and renamed properties. Checked on Boot 4.2.0.
-
Spring Boot validation error response with ProblemDetail
Validate a request record with @Valid and return one RFC 9457 ProblemDetail format with field errors. Real responses from Spring Boot 4.2 and 3.5.
-
Spring @Transactional not working: 7 causes and fixes
Why Spring @Transactional is ignored or does not roll back: self-invocation, private and final methods, checked exceptions, threads. With runnable examples.