Cloudflare R2 vs AWS S3
Comparison of two S3-compatible object stores: R2 (zero egress fees) vs S3 (deepest ecosystem, most regions).
Why
R2's headline feature is zero egress fees — you pay only for storage and operations, not for data leaving. S3 charges ~$0.09/GB egress, which dominates cost for download-heavy workloads.
S3 has more regions, storage classes, and integrations (Lambda, Athena, Macie); R2 integrates with Workers and has fewer classes.
When
Use R2 for user-generated content, large file downloads, backups, and media — anything where egress is significant. Use S3 when you need a specific region, storage class (Glacier Deep Archive), or AWS service integration (Athena, Lake Formation).
Use both: S3 for archival, R2 for hot delivery.
How
Example
Common Problems
- ⚠R2 lacks some S3 features (no Object Lock/WORM, fewer lifecycle transitions) — check the R2 compat matrix before migrating.
- ⚠S3 egress to non-AWS is expensive — put a CloudFront in front to halve it, or move hot data to R2 for zero egress.
- ⚠R2 free tier (10GB storage, 1M Class A ops/mo) is generous but operations are counted — high-frequency writes can exceed it.
Best Practices
- ✓Use R2 for hot, frequently-downloaded content (images, videos, software downloads) where egress is the cost driver.
- ✓Use S3 Glacier Deep Archive for cold backups (long-term, rarely accessed) — it is cheaper than R2 for pure storage.
- ✓Serve R2 objects through a Cloudflare custom domain (free) rather than the r2.dev URL, for clean URLs and CDN caching.
FAQ
What is Cloudflare R2 vs AWS S3 and what problem does it solve?
Comparison of two S3-compatible object stores: R2 (zero egress fees) vs S3 (deepest ecosystem, most regions). It lets developers deploy, store, and scale without self-managing infrastructure — a core reference for cloud service selection.
How do I get started with Cloudflare R2 vs AWS S3 in 5 minutes?
Two steps to run it: (1) Create a bucket on R2 (Cloudflare dashboard or wrangler) or S3 (AWS CLI).; (2) Both use the S3 API — point any S3 SDK at R2's endpoint with R2 credentials.. Validate on the free tier first, then wire into production.
What is the #1 pitfall with Cloudflare R2 vs AWS S3?
The most frequent issue is: R2 lacks some S3 features (no Object Lock/WORM, fewer lifecycle transitions) — check the R2 compat matrix before migrating.. Run a pre-launch checklist item by item, and add policy/config scanning in CI.
What are the best practices for Cloudflare R2 vs AWS S3?
Best practices for Cloudflare R2 vs AWS S3 include: Use R2 for hot, frequently-downloaded content (images, videos, software downloads) where egress is the cost driver.; Use S3 Glacier Deep Archive for cold backups (long-term, rarely accessed) — it is cheaper than R2 for pure storage.; Serve R2 objects through a Cloudflare custom domain (free) rather than the r2.dev URL, for clean URLs and CDN caching.. The first one — "Use R2 for hot, frequently-downloaded content (images, videos, software downloads) where egress is the cost driver." — should be a team default baked into your IaC templates.
How do I control cost and avoid bill surprises with Cloudflare R2 vs AWS S3?
Three ways to prevent overspend: (1) tag every resource with env/team and enable billing alarms; (2) set budget thresholds to trigger Slack/email alerts; (3) review idle resources in Cost Explorer regularly and clean them up. Most Cloudflare R2 vs AWS S3 options offer a free tier — validate within free quota before scaling.