Idempotency Patterns: Building Retry-Safe Distributed Systems
Why exactly-once is a myth, and how idempotency keys, database constraints, and the outbox pattern make retries safe in Go and Java.
Production-grade engineering for people who ship backends at scale. Distributed systems, database internals, and the trade-offs you only learn in on-call.
Why exactly-once is a myth, and how idempotency keys, database constraints, and the outbox pattern make retries safe in Go and Java.
Six reads that show what the rest of the library looks like — start here.
From 5-second startup to 50ms. The Java migration that changes K8s scaling math, with every production gotcha and a reproducible benchmark.
ReadWire thousands of API endpoints to an LLM agent without blowing the context window. Code Mode pattern + full Go implementation, security flow visualised.
ReadSame API in Spring Boot and Gin. Identical load tests on Fargate, real numbers on throughput, latency, GC pauses, and a methodology you can reproduce.
ReadWhy every scalable cache, database, and load balancer ends up here. Karger's derivation, Cassandra vnodes, and the rendezvous-hashing alternative.
ReadThe error-budget framework that turns reliability arguments into data. Multi-window burn-rate alerting, grounded in the SRE Book.
ReadWhy most RAG prototypes fail in production. Chunking, embedding versioning (1536-dim default + Matryoshka), pgvector tuning, eval pipeline.
ReadOne agent, one context window, one serial loop — until it stalls at 40 minutes and 180K tokens. The orchestrator pattern fans work out to isolated sub-agents in parallel, then synthesizes. Here's the backend, in compiling Go.
Go 1.26 makes the Green Tea garbage collector the default. What actually changed, how to measure GC CPU before and after on your own workload, and the short window you have to opt out.
Slow JVM cold start breaks scale-to-zero and autoscaling. Three ways to fix it in 2026 — Project Leyden's AOT cache, GraalVM Native Image, and CRaC — with the exact commands, the trade-offs, and a decision framework.
Go context.Context: constructors, cancellation, deadlines, request values, and five goroutine leak patterns in production.
Kafka producer configuration: acks, idempotence, batching, compression, and the tradeoffs that matter for throughput and durability.
Postgres EXPLAIN plans: node types, cost interpretation, and six patterns that kill query performance on large datasets.
2,500 API endpoints in one MCP server without blowing context windows. The Code Mode pattern uses search + execute to cut token cost by 1,000x.
AI agents calling tools via MCP create new attack surfaces: prompt injection through tool responses, credential leakage, and unauthorized execution.
Adding one cache server shouldn't invalidate every key. Consistent hashing with virtual nodes and bounded loads — full Go and Java implementations.