Consistent Error Handling in Spring Boot REST APIs
Design one error contract for your whole API using @RestControllerAdvice, ProblemDetail, and validation groups.
Tag
25 articles
Design one error contract for your whole API using @RestControllerAdvice, ProblemDetail, and validation groups.
Cache-aside, read-through, write-through, write-behind — when each pattern fits, and the invalidation trade-offs nobody escapes.
A defense-in-depth checklist for handling user-uploaded files safely, covering validation, storage, serving, and the mistakes that lead to real compromises.
Why average response time hides the experience of your worst-served users, and how to measure, diagnose, and reduce tail latency in production systems.
Why server-side request forgery became a top-tier risk in the cloud metadata era, and the layered defenses that actually contain it.
A practical framework for versioning APIs and deprecating old versions without breaking clients you don't control or can't even see.
A concrete pattern for idempotency keys in Spring Boot APIs, covering storage choice, request matching, and what to return on a replayed request.
A practical comparison of gzip, Brotli, and zstd for HTTP response compression, covering ratio, CPU cost, and where each one actually wins.
How Spring Modulith turns package structure into an enforced architectural boundary, catching the coupling that code review alone tends to miss.
How request batching and the DataLoader pattern eliminate N+1 query storms in APIs, with a look at when batching helps and when it just adds latency.
Why fast general-purpose hashes like SHA-256 are unsafe for passwords, and how bcrypt, scrypt, and Argon2 defend against modern offline cracking hardware.
Comparing MapStruct's generated mappers against hand-written mapping code across boilerplate, performance, and how each handles change over time.
A practical look at how HTTP/2 and HTTP/3 multiplexing affect application design, when it helps, and where old HTTP/1.1 habits still hurt you.
A practical guide to OAuth 2.0 and OpenID Connect flows for application developers, covering authorization code with PKCE and why implicit flow is obsolete.
Why the default executors behind @Scheduled and @Async are wrong for production, and how to configure thread pools that actually match your workload.
Using Spring's application event system to decouple side effects from core business logic, and the transactional pitfalls that come with it.
Transport-layer and application-layer load balancers make routing decisions with very different visibility — here's what each one trades off.
Moving past @NotBlank and @Email to validation groups, custom constraint annotations, and cross-field rules that Bean Validation can express cleanly.
How to combine Resilience4j's circuit breaker, bulkhead, and retry modules in Spring Boot without letting them fight each other.
Idempotency keys, atomic check-and-write, and why PUT being idempotent by spec doesn't make it the right tool for a retried write.
The WebClient configuration that RestTemplate never forced you to think about, and why the defaults are wrong for most production traffic.
How Spring Boot's test slice annotations work, where they save real time, and the point at which reaching for @SpringBootTest is the better call.
A pragmatic approach to Spring profiles and externalized configuration that avoids property sprawl and keeps environment differences honest.
Fixed window, sliding window, token bucket, and leaky bucket rate limiters compared, with the burst and fairness trade-offs each one hides.