
Caching Strategies and Invalidation
Field notes on caches that lied: the four caching patterns, TTL guidance by data type, and why one hot key going stale can bring your database down with it.
Category

Field notes on caches that lied: the four caching patterns, TTL guidance by data type, and why one hot key going stale can bring your database down with it.

pgrust just passed 100% of Postgres's 46,000+ regression tests — 450K lines of Rust written by eight parallel AI agents in 12 weeks. Is it production-ready?

Just use Postgres for everything: in July 2026 one instance absorbs caching, queues, full-text search and vectors, erasing the tax of seven systems.

One ALTER TABLE locked a production table for minutes. Here's the expand-contract pattern, batched backfills, and CREATE INDEX CONCURRENTLY done right.

Most feature flag systems calcify into permanent debt. Here's how flag types, clear ownership, expiry dates, and a cleanup workflow can prevent that.

A downstream dependency slowed down for 90 seconds — our retry logic took it down completely. Here's what jittered backoff actually prevents, and why.

Rate limiting isn't one algorithm choice — it's three decisions: where you enforce it, what key you use, and only then which algorithm to run.

A list endpoint was firing 400 queries and taking 6 seconds to load. Here's how we detected the N+1 problem and cut it down to 2 queries with eager loading.

A payment request timed out, the mobile app retried automatically, and the customer got charged twice. Here's how idempotency keys and UPSERT prevent that.