Overview
EdgeOne Pages provides built-in persistent storage capabilities that can be used directly within Pages Functions, eliminating the need to set up a separate backend or integrate with third-party services.
Two storage types are currently supported:
KV — A distributed key-value store, suitable for storing single-point states such as configurations, counters, and sessions.
Blob — A distributed object storage service designed for unstructured data such as images, documents, user-uploaded files, and AI-generated content, with support for directory hierarchies.
How to choose
Simple Rule of Thumb: Use KV for storing a few small key-value pairs; use Blob for storing objects, or when you need directory hierarchies or to handle larger data.
Features | KV Storage | Blob Storage |
Positioning | Distributed variable | Distributed object collection |
Data organization | Flat key → value | Organized by / path, supporting directory hierarchy. |
Maximum single value size | 25 MB | 25 MB |
Runtime environment | Edge Functions only | Edge Functions / Cloud Functions |
Access method | Enable via console → Create namespace → Bind project | Call getStore('name') to use it immediately, with no configuration required. |
Consistency | Eventual consistency within 60 seconds | Eventual consistency within 60 seconds |
Use Cases for KV
Access counters, click statistics, rate-limiting counters
Feature Flags (feature switches), A/B testing configurations
User sessions, login states
Sensitive configurations such as API keys
Use Cases for Blob
Images, attachments, and documents uploaded by users
AI-generated images, documents, and reports
Structured datasets organized by directory (multiple JSON files, batch records, and so on)
Scenarios that require reading the latest value immediately after a write operation
Quick Comparison
// KV: Access via bound variable namesawait my_kv.put("visitCount", "1");const count = await my_kv.get("visitCount");
// Blob: Use directly via the SDKimport { getStore } from "@tencent/pages-blob";const store = getStore("uploads");await store.set("photos/cat.jpg", imageData);const file = await store.get("photos/cat.jpg");
For the complete usage guides, API references, and working principles of each storage type, see KV and Blob.