KV Store

Fast key-value storage built for global applications

Eventually consistent key-value storage with automatic global replication. Designed for read-heavy workloads and modern applications.

Low-latency reads worldwide

Serve sessions, feature flags, configuration, and lookup data close to users for fast decisions in global applications.

Simple key-value API at scale

Store and retrieve application state with a schemaless API that supports JSON, binary data, streams, metadata, and TTLs.

Persistent state beyond cache

Keep durable key-value data available for read-heavy workloads, instead of relying on volatile cache entries or repeated origin lookups.

Native JavaScript API for Functions

Access KV Store directly from Functions to store and retrieve sessions, flags, and counters without extra network hops. Cloudflare Workers KV API compatible for easy migration.

KV Store JavaScript API workflow for application state.

Store any data type, no schema required

Store JSON objects, binary data, and streams without rigid schemas or serialization overhead. Attach metadata for additional context.

KV Store flexible data types including JSON objects, binary buffers, and streams with metadata
HeroSpark
Azion transformed our operations, reducing costs and improving performance while freeing 200+ monthly hours for strategic development.
Mateus LeonardiCTO at HeroSpark

From key-value to full application state

KV Store integrates with Functions, SQL Database, and Object Storage for complete application state management.

kv-store.ts
01import { createClient } from 'azion/kv';
02import type { KVClient } from 'azion/kv';
03
04const client: KVClient = await createClient({
05 namespace: 'app-state'
06})
07 .on('error', (err) => console.error('KV error:', err))
08 .connect();
09
10// Store a session with TTL
11await client.set(
12 'session:user-123',
13 JSON.stringify({ userId: 'user-123', role: 'admin' }),
14 { expiration: { type: 'EX', value: 3600 } }
15);
16
17// Retrieve the session
18const session = await client.get('session:user-123');
19console.log(session);
20
21// Increment a counter
22await client.incr('api:calls:today', 1);

Session management and authentication

Store user sessions, authentication tokens, and login states close to users for fast authentication. Fast reads enable responsive session validation without round-trips.

Feature flags and configuration

Synchronize feature flags and application configuration globally with low latency. Safely roll out features, run A/B tests, and manage settings with TTL.

API rate limiting and quotas

Implement sliding window rate limits, token quotas, and access rules. Track API usage per IP, user, or token with fast lookups to protect APIs.

Global counters and analytics

Count pageviews, inventory levels, and API usage in real time with distributed counters. Aggregate metrics across regions with eventual consistency.

Bad actor tracking and security lists

Store IP addresses and threat signatures to block attackers in real time. Query large block lists with low-latency access to prevent malicious access.

A full-stack platform that scales instantly

Frequently Asked Questions

//Store

Your data.Available everywhere.

Get faster access, simpler scaling, and less storage overhead as data grows.