Author
September 29, 2025
3 min read

Building a globally distributed application once required piecing together AWS RDS, S3, ElastiCache, and CloudFront—a configuration that could cost hundreds of dollars per month before a single user signed up. Cloudflare's trio of native storage products changes that equation entirely.
D1 is a globally distributed SQLite database built on the SQLite foundation. It excels at relational data: user profiles, blog posts, transaction records, and any data that benefits from JOINs, indexes, and ACID guarantees. D1 integrates directly with Workers via a bindings API, eliminating the connection pooling and latency overhead of traditional remote databases.
R2 is S3-compatible object storage with a killer feature: zero egress fees. Unlike AWS S3, which charges when data leaves its network, R2 is free to serve data from. This makes it ideal for user uploads, image assets, video files, and backups. With public bucket URLs, R2 can serve content directly to browsers without a proxy.
KV is a globally replicated key-value store optimized for high-read, low-write workloads. Its secret weapon is read-after-write consistency within a single region and eventual consistency globally, which means reads are virtually instant from any data center. KV is perfect for session tokens, feature flags, cached API responses, and configuration that must be available everywhere.
The real power emerges when you combine them. A typical pattern: D1 stores the canonical data (user accounts, orders), R2 holds the associated blobs (profile pictures, receipts), and KV caches the most frequently accessed queries to reduce D1 reads.
For example, a blog platform stores post metadata and content in D1, keeps images in R2, and caches the home page query—a list of recent posts with their metadata—in KV. When a new post is published, the Worker writes to D1, uploads the featured image to R2, and invalidates the KV cache entry. The next read hits KV instantly, keeping P95 response times under 50ms.
Cloudflare's free tier covers 100,000 D1 reads per day, 10 GB of R2 storage, and 100,000 KV read operations per day. For a personal blog or small SaaS application, this is genuinely free. Even at scale, the costs remain dramatically lower than comparable managed services because there are no egress fees and no per-request markups.
The architecture is not appropriate for every workload—write-heavy applications or those requiring complex transactions may need a traditional database. But for the majority of full-stack applications, D1 + R2 + KV delivers production-grade infrastructure at a fraction of the cost.