R2 Object Storage

What is it?

R2 is Cloudflare's object storage service — think of it as Cloudflare's answer to Amazon S3. It stores files (objects) of any size and type: images, videos, backups, datasets, logs, and more. The key differentiator: R2 has zero egress fees. While AWS, Google, and Azure charge significant fees every time you read data out of their storage, R2 doesn't charge for egress at all.

What problem does it solve?

Cloud storage has a dirty secret called data egress fees — the charges you pay to retrieve your own data:

  • Vendor lock-in: High egress fees make it prohibitively expensive to move data between providers or serve data to users. This is how AWS keeps customers locked in.
  • Unpredictable costs: Applications that serve a lot of data (media, backups, machine learning datasets) face enormous and unpredictable egress bills.
  • Multi-cloud barriers: Companies that want to use multiple cloud providers are penalized for moving data between them.

By eliminating egress fees, R2 removes the economic lock-in of traditional cloud storage.

How does it work?

R2 is S3-compatible, which means:

  • Any application, tool, or SDK that works with Amazon S3 can work with R2 with minimal changes (just change the endpoint URL).
  • Standard operations: PUT (upload), GET (download), DELETE, LIST.
  • Objects are stored with metadata and can be organized into buckets.
  • Data is automatically distributed across Cloudflare's network for durability and availability.
  • R2 integrates natively with Workers, so you can process uploads, generate thumbnails, or transform files on-the-fly at the edge.

Key features:

  • Event Notifications: Trigger Workers when objects are created or deleted.
  • Public Buckets: Serve static assets directly from R2 with automatic CDN caching.
  • Lifecycle Policies: Automatically delete or transition objects after a set time.

Why it matters strategically

R2 is a direct attack on AWS's revenue model. Egress fees generate billions in revenue for cloud providers, and R2's zero-egress pricing is designed to attract customers away from S3. It's also a critical piece of Cloudflare's developer platform — developers building on Workers need a place to store files, and R2 provides that natively. The S3-compatibility strategy was deliberate: it lowers the switching cost from AWS to near zero.

Learn more