100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Cloud

Cloudflare R2

BeginnerService12.3K learners

Cloudflare R2 is an S3-compatible object storage service that lets developers store and serve large amounts of unstructured data — such as images, videos, backups, and static assets — with no data egress (bandwidth) fees for retrieving…

Definition

Cloudflare R2 is an S3-compatible object storage service that lets developers store and serve large amounts of unstructured data — such as images, videos, backups, and static assets — with no data egress (bandwidth) fees for retrieving that data.

Overview

Object storage services like Amazon S3 are the standard way to store files at scale on the cloud, but egress fees — the cost of transferring data out of the storage provider's network — can become a significant and unpredictable expense for data-heavy applications, particularly those serving large files like video or images to end users. Cloudflare R2 was built specifically to remove that friction: it charges for storage and for Class A/B operations (writes and reads), but charges zero fees for data egress, regardless of how much data is downloaded. R2 exposes an API compatible with Amazon S3's, meaning most existing S3 SDKs, CLI tools, and libraries can point at R2 with minimal configuration changes, which lowers the migration cost for teams moving off S3 or building multi-cloud storage strategies. R2 buckets can also be bound directly to Cloudflare Workers, allowing serverless functions running on Cloudflare's edge network to read and write objects with low latency, and can be exposed publicly via a custom domain fronted by Cloudflare's CDN for content delivery without a separate CDN configuration step. R2 targets the same broad use cases as other object stores — static website assets, user-uploaded content, backups, data lake storage, and machine learning datasets — but is particularly attractive for workloads with high read/download volume relative to storage size, since that is exactly where S3-style egress fees compound. It also supports S3-compatible features like presigned URLs, multipart uploads for large files, and lifecycle rules, though it does not replicate every advanced S3 feature (such as S3 Select or certain storage classes) at parity. Because it runs on Cloudflare's global network, objects can be served with the low latency and DDoS protection benefits of Cloudflare's edge, making R2 popular for teams already using Cloudflare Workers, Pages, or CDN services who want to consolidate their storage and delivery stack.

Key Features

  • S3-compatible API, largely interoperable with existing S3 tooling
  • Zero data egress fees, unlike most competing object storage services
  • Direct binding to Cloudflare Workers for low-latency edge access
  • Public buckets can be served via Cloudflare's CDN and custom domains
  • Supports multipart uploads, presigned URLs, and lifecycle rules
  • Pay for storage and operations, not for bandwidth out
  • Built on Cloudflare's global network infrastructure
  • Commonly paired with Cloudflare Pages and Workers for full-stack apps

Use Cases

Serving static assets and media (images, video) at scale
Storing user-uploaded content for web and mobile apps
Backups and archival storage with predictable low cost
Data lake storage for analytics pipelines
Hosting machine learning training datasets and model artifacts
Reducing egress costs for high-traffic content delivery
Multi-cloud or S3-migration strategies leveraging S3 API compatibility

Alternatives

Amazon S3 · AWSGoogle Cloud Storage · GoogleBackblaze B2 · BackblazeAzure Blob Storage · Microsoft

Frequently Asked Questions