zudo-cloudflare-wisdom
GitHub repository

Type to search...

to open search from anywhere

Storage

KV, D1, R2, and Vectorize storage services

Cloudflare offers four storage services, each optimized for different access patterns.

Overview

ServiceTypeBest ForConsistency
KVKey-value storeRead-heavy, eventually consistent dataEventual
D1SQL database (SQLite)Relational data, complex queriesStrong
R2Object storage (S3-compatible)Files, images, large blobsStrong
VectorizeVector databaseEmbedding similarity search, RAG retrievalAsync index updates

Choosing the Right Service

graph TD A[What kind of data?] --> B{Structured/relational?} B -->|Yes| C[D1 - SQL database] B -->|No| D{Large files/blobs?} D -->|Yes| E[R2 - Object storage] D -->|No| H{Vector embeddings for similarity search?} H -->|Yes| I[Vectorize - Vector database] H -->|No| F{Read-heavy, ok with eventual consistency?} F -->|Yes| G[KV - Key-value store] F -->|No| C

In This Section

  • KV -- Key-value namespace usage patterns

  • D1 -- SQL database with SQLite

  • R2 -- Object storage for files

  • Vectorize -- Vector database for embeddings and similarity search

Revision History

CreatedUpdated