Exactly-Once POSTs: Idempotency Keys in Spring Boot (Stripe-Style)

The client times out waiting for your POST /orders. It retries. Your server processes it twice. The customer gets charged twice, and your support queue gets a new entry titled in all caps. Stripe solved this a decade ago with one header: Idempotency-Key. The client generates a UUID, sends it with the request, and retries with the same key — Stripe guarantees one effect per key. It’s the industry reference implementation (docs, engineering blog), and there’s no reason your API can’t offer the same contract. Let’s build it. ...

2026-09-25 · 7 min · Ramesh

JUnit 6 Just Landed in Your Spring Boot 4.1 BOM: What Actually Changed

You bumped spring-boot-starter-parent to 4.1, ran the build, and noticed something in the test output: junit-jupiter:6.x. Nobody asked for it, nothing in your test code changed, and everything still passes. So what did you just get — and what breaks the day it doesn’t? Short version: JUnit 6 is mostly a cleanup release wearing a major version number. For a typical Spring Boot app, the migration is deleting lines from your pom.xml, not adding them. The pain lives in three specific removed APIs and two build plugins. Let’s go through all of it with code. ...

2026-09-21 · 6 min · Ramesh

Rate Limiting in Spring Boot: The System Design Interview Answer, in Code

Rate limiting shows up in two places: your on-call rotation and your system design interview. Both reward the same thing — knowing which algorithm to pick, why, and what breaks at scale. This guide builds three working limiters in Spring Boot, each with tests: Fixed window — the simplest thing that works, hand-rolled. Token bucket — smooth, burst-friendly, via Bucket4j. Distributed sliding window — precise and shared across instances, on Redis with Lua. Then we close with the part interviews actually grade: how to talk through the tradeoffs. ...

2026-09-20 · 8 min · Ramesh

Flipping spring.threads.virtual.enabled=true? Read This First

Virtual threads can be one of the easiest throughput wins in a blocking Spring Boot application. The switch is one line: spring: threads: virtual: enabled: true But that line changes the concurrency model of the application. It does not make database queries faster, reduce API latency, or create more database connections. It makes waiting cheaper by allowing many request tasks to share a smaller number of carrier threads. ...

2026-09-20 · 10 min · Ramesh