When a Rate Limiter Needs a Brain: Durable Objects for Per-Tenant State at the Edge
A counter in a Worker's memory doesn't add up across locations. Here's how Durable Objects serialize per-tenant state, with a worked limiter and its limits.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
A counter in a Worker's memory doesn't add up across locations. Here's how Durable Objects serialize per-tenant state, with a worked limiter and its limits.
Learn how to identify when a Cloudflare Worker hits the 50‑subrequest limit, why it happens, and what steps to take to reduce or raise the limit.
How the Cloudflare Workers Cache API (caches.default) stores responses per datacenter, with a working example covering ctx.waitUntil, body cloning, cache-key normalization, and the mistakes that cause silent misses.
Choose Workers KV for fast, read-heavy session storage with eventual consistency. Use Durable Objects when you need linearizable reads/writes and can accept higher latency and cost.
Decide whether Cloudflare Workers KV or Durable Objects is better for per‑user session storage based on latency, consistency, and operational trade‑offs.
Learn how to use Cloudflare Workers KV to share mutable state like feature flags across all edge instances, with a concrete code example, trade‑offs, and a verification checklist.
Cloudflare Workers KV offers low‑latency global reads, but its eventual consistency and write limits mean you need to design for staleness and throttling. This guide walks through a counter example, shows how to bind KV, and explains when KV is a good fit.
Learn how to use Cloudflare Workers KV to enforce per‑user request quotas with sliding‑window counters, including a runnable example and verification steps.
Learn when to use Workers KV for global read performance versus Durable Objects for strong consistency and atomic state management in Cloudflare Workers.