API Idempotency Keys
When a client retries a failed request, the server cannot tell a duplicate from a new request — unless the client sends an idempotency key. This video shows how the key is stored, how a unique constraint deduplicates retries at the database level, and what happens when two retries race through the handler at the same time.
Topics covered:
- The problem: retries create duplicate side effects
- The key: a client-generated string stored with the request
- Dedupe tables and unique constraints at the database level
- First-write wins: locking and the concurrent retry race
- Key expiry and the replay window
- Payment APIs and why Stripe made idempotency keys standard
Related articles
Idempotency Keys and Retry Safety: How APIs Guarantee Exactly-Once
How idempotency keys turn at-least-once delivery into exactly-once effects: key storage, replay windows, concurrency, and idempotency-key header semantics.
Connection Pools Aren't Free
Pool sizing, exhaustion, idle connections, and the hidden queue — why 'just add a pool' is incomplete advice.
Circuit Breakers and Timeouts: Protecting Services from Cascading Failure
Circuit breaker states — closed, open, half-open — plus timeout budgets and retry limits: the mechanisms that stop cascading failures before they spread.
More in Backend Engineering
Pagination Strategies
Offset, keyset, and cursor pagination compared by database cost, consistency, and behavior when rows are inserted mid-page.
DetailsCaching for the Service Layer
Service-layer caching done right — cache keys, invalidation, TTLs, and the stampede problem that brings services down.
DetailsWebhooks vs Polling
Webhooks and polling compared at the delivery level — delivery guarantees, retries, and when push is worse than pull.
DetailsDatabase Transactions in Practice
ACID in a real database — write-ahead logs, locks, undo and redo, plus isolation levels and what they change about reads.
DetailsRate Limiting Algorithms, Visualized
Token buckets, leaky buckets, and sliding windows compared by memory, precision, and what they do under burst load.
DetailsBackground Job Processing
Queues, workers, and retries — how background jobs actually execute, from enqueue to acknowledgment, and why they fail.
DetailsREST APIs from the Inside
What happens when a REST API processes a request — routing, deserialization, validation, handlers, and response building end to end.
DetailsMessage Queues in Practice
Brokers, producers, and consumers — what a queue does at the protocol level and why it decouples services from availability.
DetailsConnection Pooling Explained
What a connection pool actually does — the handshake cost it hides, checkout and release mechanics, and how pool size changes latency.
DetailsDepth, delivered weekly
One technical dispatch a week — articles and episode notes before they go public.
One technical dispatch per week. No noise.