---
title: "Key-value"
---

> Documentation Index
> Fetch the complete documentation index at: https://ermahgerd-docs.t-bd7662a5eeb4.workers.ermahgerd.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Key-value

Store small configuration values and metadata in organization-owned namespaces.
Workers use Wrangler's KV binding contract. Each value is limited to 64 KiB;
use [Object storage](/build/storage/) for images, files, and large documents.

## Create and bind a namespace

Create a namespace in **Data → Key-value** in the tenant console, or use
Wrangler after [configuring your connection](/build/connect-wrangler/):

```sh
npx wrangler kv namespace create SETTINGS
```

Copy the returned namespace ID into the Worker configuration:

```toml
[[kv_namespaces]]
binding = "SETTINGS"
id = "<namespace-id>"
```

Deploy with Wrangler, then use the binding:

```js
await env.SETTINGS.put("theme", JSON.stringify({ color: "blue" }), {
  expirationTtl: 3600,
});
const theme = await env.SETTINGS.get("theme", "json");
const keys = await env.SETTINGS.list({ prefix: "theme" });
await env.SETTINGS.delete("theme");
```

The platform validates namespace ownership when binding and executing requests.
Another organization's namespace ID does not grant access to its values.

## Browse and manage values

Open a namespace to browse keys by prefix, inspect UTF-8 values and JSON
metadata, and review expiration and activity. Read-write users can manage
values and rename or delete the namespace. Deletion removes its contents and
breaks Workers that still bind it; review the target before confirming.

## Limits and persistence

**Usage & limits** tracks namespaces, live keys, stored-value bytes, and period
operations. Writes reserve growth before committing. Deletion and expiration
return holding capacity. Reads, writes, deletes, and lists consume operations.

Data is durable on the selected service host. This is a single-region service
without automatic replication or failover; it does not reproduce Cloudflare's
globally distributed KV cache. Check [Usage and quotas](/build/usage-and-limits/) for current
allowances.

Source: https://ermahgerd-docs.t-bd7662a5eeb4.workers.ermahgerd.io/build/key-value/index.mdx
