Edge KV / distributed key-value store

A small key-to-value database copied across regions so edge code can read settings near the visitor.

tiny database available in every regionread settings close to the userchange a setting without redeploying the whole appwhere do I store feature flags at the edgefast lookup table near usersI flipped the flag but Europe still sees the old valuesomewhere to keep redirect rules that every region can readdistrubuted KV store

See it

Live demo coming soon

What it is

An edge KV store keeps small values under simple keys and replicates them so edge code can read nearby instead of calling one distant database. Cloudflare Workers KV is the familiar example, with Vercel Edge Config and Deno KV filling the same slot elsewhere: a key might hold a feature flag, redirect rule, tenant setting, or cached JSON document.

Reach for it when reads are frequent, values are small, and a slightly stale copy is acceptable. It is especially handy for configuration and routing decisions made before a request reaches the origin.

Global replication is not instant. Cloudflare documents Workers KV as eventually consistent, with updates typically visible worldwide within about 60 seconds, and providers cap value size, write rate, and operations besides. Do not use an eventually consistent edge KV store for locks, exact counters, inventory, or read-after-write workflows.

Ask AI for it

Create a Cloudflare Worker with a Workers KV namespace binding named CONFIG_KV in wrangler.jsonc. Read tenant configuration with env.CONFIG_KV.get(key, { type: "json" }), validate the returned shape, use a safe default when the key is missing, and place writes behind an authenticated admin route. Do not use KV for counters or locks, and document that updates can be temporarily stale in other locations.

You might have meant

edge functionedge runtime vs node js runtimecache keyregion multi regioncdn